From 14fdde56d8df41acfb7e45a061c3f282a1cf7c13 Mon Sep 17 00:00:00 2001 From: zeus Date: Tue, 24 Nov 2020 19:51:11 +0200 Subject: [PATCH] mongo tail --- swarmlab-app/src/run/app.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 94258eb..9f584c6 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -271,17 +271,10 @@ MongoClient.connect(mongourl, OPTS, function(err, client){ /* other options */ }).stream(); -stream.on('data', function (doc) { +db.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) { - console.log(coll.s.name); - }); - }); - */ } }); var RES = new Object(); @@ -451,7 +444,7 @@ MongoClient.connect(mongourl, OPTS, function(err, client){ /* other options */ }).stream(); -stream.on('data', function (doc) { +db.on('data', function (doc) { console.log(JSON.stringify(doc)) //socket.write(JSON.stringify({'action': 'log','param': doc.log})); });