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