please forward my following answer to node.js: Mongodb db.collection.find() not working while collection.insert works
you did use: collection.find({name:req.body.name}).limit(1).size() 1 you can also use cursor variable for limit. or different syntax from mongo shell. 2 or use the cursor var within your javascript file(see below):
------------------------------------------------
1 (mongo-shell)> db.collection.find({name:req.body.name},{$limit:1,$skip:10}) or:
db.collection.find({name:req.body.name},"$limit":1,"$skip":10})
or better use the cursor var within your js file:
var query = {name:req.body.name}
var cursor=db.collection.find(query);
cursor.sort({"name":1});`enter code here`
cursor.limit(10);
cursor.skip(100);