Browse Source

mongo tail

master
zeus 4 years ago
parent
commit
14fdde56d8
  1. 11
      swarmlab-app/src/run/app.js

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

@ -271,17 +271,10 @@ MongoClient.connect(mongourl, OPTS, function(err, client){
/* other options */ /* other options */
}).stream(); }).stream();
stream.on('data', function (doc) { db.on('data', function (doc) {
console.log(JSON.stringify(doc)) console.log(JSON.stringify(doc))
//socket.write(JSON.stringify({'action': 'log','param': doc.log})); //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(); var RES = new Object();
@ -451,7 +444,7 @@ MongoClient.connect(mongourl, OPTS, function(err, client){
/* other options */ /* other options */
}).stream(); }).stream();
stream.on('data', function (doc) { db.on('data', function (doc) {
console.log(JSON.stringify(doc)) console.log(JSON.stringify(doc))
//socket.write(JSON.stringify({'action': 'log','param': doc.log})); //socket.write(JSON.stringify({'action': 'log','param': doc.log}));
}); });

Loading…
Cancel
Save