Created
April 13, 2015 08:17
-
-
Save christkv/ae7cf17696cc2545ecbd to your computer and use it in GitHub Desktop.
Stream example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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