From 3039d41f79f35d5e8d7f8096b6fb707e83ceb407 Mon Sep 17 00:00:00 2001 From: zeus Date: Tue, 24 Nov 2020 21:53:19 +0200 Subject: [PATCH] mongo tail --- swarmlab-app/src/run/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index ca839a6..b8851ee 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -404,11 +404,16 @@ function onCollection(err, collection) { // cursorStream = cursor.stream(), var itemsProcessed = 0; + var reslog = new Object(); + var now = new Date(); //cursorStream.on('data', function (data) { cursor.on('data', function (data) { + reslog.log = data + reslog.date = convertDateToUTC(now) console.log('data ' + data.value); var user = "anagnostopoulos@uniwa.gr" - io.in(user).emit("logdata", data.value); + //io.in(user).emit("logdata", data.value); + io.in(user).emit("logdata", reslog); itemsProcessed++; });