However when I apply it on my back-end (server folder) I get the following error message:
TypeError: Object [object Object] has no method 'limit'
Strangely, the same command works directly in the command line without problems. This is the line of code:
var resultFind = Scrape.find({userId: scrapeUser, screen: "selectScreen"}, {_id:1}).limit(1);
Using the same line of code except the .limit(1) returns exactly as wanted. What am I missing here? BTW, it didn’t work for another collection either, tried it on Meteor.users (again, works in command line without problems)
right because fudging the [options] to the query in that way doesnt produce an error, still though, you’ll need to use {fields: …} syntax
The doc does have several examples btw, just look up "fields: " or "limit: " also, in the link I sent you, they explicly say the fields on the [options] object
personally i’ve found meteor docs to be of high quality xD
edit:
your second line of code is correct. the first is incorrect, because it will interpret “limit” to be a field on your documents. sorry lol, i abuse editing …