0

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);
  • 1
    Did you follow the advice that was likely printed when you created the project and the suggestion in your error output? `meteor npm i` and `meteor npm install --save babel-runtime`? – MasterAM Jun 09 '17 at 12:00
  • it helped meteor works ok - however using node and express + some other packages is sufficient even not the fastest response time is enough for most cases – canadian_nerd Sep 01 '17 at 19:53

0 Answers0