I was butting my head yesterday trying to get an array of query results within Meteor using
cursor.toArray()
(See http://docs.mongodb.org/manual/reference/method/cursor.toArray/)
I could not get it to work. Finally I tried it in the Meteor mongo console and it worked fine.
I'm a Meteor newbie — what am I missing here? is there a reference that tells me what mongo code can be executed client side ? I looked in the Meteor docs and wasn't able to find. When I look for what I can do in Meteor I often find myself looking through the Mongo docs (as per above) — to what extent are these relevant in minimongo?
Thanks!
I think you should stick to the Mongo collections part in the Meteor docs :
https://docs.meteor.com/api/collections.html
This is the reference which addresses subject such as current minimongo limitations and most importantly, which API are available on the client and on the server regarding MongoDB manipulation.
As far as toArray
is concerned, the closest minimongo implemented counterpart would be fetch
.
https://docs.meteor.com/api/collections.html#Mongo-Cursor-fetch