Browse Source

mongo tail

master
zeus 4 years ago
parent
commit
b69b58041a
  1. 6
      swarmlab-app/src/run/app.js

6
swarmlab-app/src/run/app.js

@ -266,7 +266,7 @@ MongoClient.connect(mongourl, OPTS, function(err, client){
const db = client.db('fluent'); const db = client.db('fluent');
//db.collection('log', onCollection); //db.collection('log', onCollection);
console.log(JSON.stringify('mongo connected')) console.log(JSON.stringify('mongo connected'))
var stream = db.collection('log').find({}, { var stream = db.collection('logs').find({}, {
tailable: true, tailable: true,
awaitdata: true awaitdata: true
/* other options */ /* other options */
@ -434,8 +434,8 @@ MongoClient.connect(mongourl, OPTS, function(err, client){
console.log(err); console.log(err);
} else { } else {
const db = client.db('fluent'); const db = client.db('fluent');
db.collection('log', onCollection); db.collection('logs', onCollection);
var stream = db.collection('log').find({}, { var stream = db.collection('logs').find({}, {
tailable: true, tailable: true,
awaitdata: true awaitdata: true
/* other options */ /* other options */

Loading…
Cancel
Save