Lets say we have a posts collection, and embedded in posts is an array of comments.
How would I write a query to say, pull out only posts 11-20? A mongoid solution would be preferable, but a mongo query object would also be fine
Lets say we have a posts collection, and embedded in posts is an array of comments.
How would I write a query to say, pull out only posts 11-20? A mongoid solution would be preferable, but a mongo query object would also be fine
You want the $slice operator
http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24sliceoperator