Browse Source

mongo tail

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

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

@ -374,12 +374,13 @@ function onCollection(err, collection) {
numberOfRetries: -1,
tailableRetryInterval: 500
};
//collection.find().cursor(options);
var cursor = collection.find({}, options),
cursorStream = cursor.stream(),
itemsProcessed = 0;
var cursor = collection.find().cursor(options);
//var cursor = collection.find({}, options),
// cursorStream = cursor.stream(),
// itemsProcessed = 0;
cursorStream.on('data', function (data) {
//cursorStream.on('data', function (data) {
cursor.on('data', function (data) {
console.log(data.value);
itemsProcessed++;
});

Loading…
Cancel
Save