Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db = connect("localhost:27017/test");
- var cursor = db.unicorns.find({gender : "m"});
- var total = 0;
- while(cursor.hasNext()) {
- var obj = cursor.next();
- total += (obj.hits || 0);
- }
- print(total);
Add Comment
Please, Sign In to add comment