I want to find all items before a certain item in mongomapper.
For example if I have five User classes saved and I pass in the ID of user 3 then I expect to get back the first two items.
Any开发者_高级运维 ideas how to do this efficiently?
The ObjectID key in Mongo is comprised of a few things, one of them being a timestamp. You can probably use that as a condition on which to query. Look here for more details, http://mongotips.com/b/a-few-objectid-tricks/
精彩评论