-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
It will be nice if cursor.each() will check for return code of callback. Based on this it should escape from iteration. See http://api.jquery.com/each for example of such API.
Usa case: get only 20 documents, for example
items = [] cursor.each(function(err, item) { if (err != null) return false; items.push(item); if (items.length >= 20) { return false; } return true; });