Skip to content

Instantly share code, notes, and snippets.

@christkv
Created April 13, 2015 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christkv/ae7cf17696cc2545ecbd to your computer and use it in GitHub Desktop.
Save christkv/ae7cf17696cc2545ecbd to your computer and use it in GitHub Desktop.
Stream example
var cursor = GLOBAL.db.collection("data").find({ dataId : dataId }, { _id : 1, data : 2 }, { "sort" : [[ '_id', 1 ]] });
cursor.on('data', function(doc) {
});
cursor.on('error', function(err) {
});
cursor.on('end', function() {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment