I need to use limit and skip to get some record from mongo.
I am using MongoJS with NodeJS but below given is not working.
Below is an example:
db.users.find(function(err,doc{
console.log(doc);
})).skip(2).limit(2);
also I have tried something like:
db.users.find({ skip:0, limit: 5 }, function(err, results) {
console.log(results);
});
I am new to JS/NodeJS/MongoJS ,Please let me know how can I use above code correctly .