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
Post a Comment