Skip to content

Instantly share code, notes, and snippets.

@rajanand02
Last active August 29, 2015 14:09
Show Gist options
  • Save rajanand02/b8451b71c51e3618a216 to your computer and use it in GitHub Desktop.
Save rajanand02/b8451b71c51e3618a216 to your computer and use it in GitHub Desktop.
Mongo skip and limit in meteor subscription
Meteor.publish("posts",(skip,limit)->
return Posts.find({post_id:this.userId},{sort:{date:-1},limit:limit,skip:skip})
)
Meteor.subscribe("posts",10,568)
# use session variables to keep track of limit and skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment