meteor mongodb limit return only id -


i want limit number of post query

db.posts.find({}); 

i got posts. want first 10 posts i've done this.

db.posts.find({}, {limit: 10}); 

but instead of having 10 posts, return id posts

it looks you're doing in mongo shell rather in meteor app directly. limit syntax differs between 2 environments:

mongo shell (docs):

db.posts.find().limit( 10 ) 

meteor js:

posts.find({},{limit: 10}); 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -