|
|
@ -437,23 +437,18 @@ MongoClient.connect(mongourl, OPTS, function(err, client){ |
|
|
|
} else { |
|
|
|
const db = client.db('fluent'); |
|
|
|
db.collection('logs', onCollection); |
|
|
|
/* |
|
|
|
var stream = db.collection('logs').find({}, { |
|
|
|
tailable: true, |
|
|
|
awaitdata: true |
|
|
|
/* other options */ |
|
|
|
//other options
|
|
|
|
}).stream(); |
|
|
|
|
|
|
|
stream.on('data', function (doc) { |
|
|
|
console.log('doc ' + JSON.stringify(doc)) |
|
|
|
//socket.write(JSON.stringify({'action': 'log','param': doc.log}));
|
|
|
|
}); |
|
|
|
/* |
|
|
|
db.collection(function(err, collections) { |
|
|
|
collections.forEach(function(coll) { |
|
|
|
console.log(coll.s.name); |
|
|
|
}); |
|
|
|
}); |
|
|
|
*/ |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|