From 151ab6cfbc49bd52f36a619b50d43931d28ed1cb Mon Sep 17 00:00:00 2001 From: zeus Date: Tue, 24 Nov 2020 21:09:03 +0200 Subject: [PATCH] mongo tail --- swarmlab-app/src/run/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 1733800..0c80279 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -406,7 +406,9 @@ function onCollection(err, collection) { //cursorStream.on('data', function (data) { cursor.on('data', function (data) { - console.log(data.value); + console.log('data ' + data.value); + var user = "anagnostopoulos@uniwa.gr" + io.in(user).emit("logdata", reslog); itemsProcessed++; }); @@ -442,7 +444,7 @@ var stream = db.collection('logs').find({}, { }).stream(); stream.on('data', function (doc) { - console.log(JSON.stringify(doc)) + console.log('doc ' JSON.stringify(doc)) //socket.write(JSON.stringify({'action': 'log','param': doc.log})); }); /*