Lets say i have a users collection
with 1000 documents
like
{
"_id": ObjectId("5923cef9421aa90aeafc3c0c"),
name: "hariharasudhan",
email: "test@gmail.com",
"inserted_at" : ISODate("2017-05-23T05:56:09.501Z")
}
As a developer i would like to fetch 50 documents
at each interval rather than going for 1000 documents at once, for example on each request from the user i would like to return 50 documents
whose datetime $gt
than ISODate("2017-05-23T05:56:09.501Z")
, how to achieve this in mongo?