I'm new to mongoose and i found that the mongoose-pagination
module is easy to use. Now i want to combine the sort function with pagination function, but i couldn't succeed. These are two function that i would like to combine
feeds.find({}).paginate(pageNumber, 10, function(err, docs, total) {
});
feeds.find({}).sort({pubDate: -1}).exec(function (err, docs) {
if (err) {
throw err;
} else {
}
});
My questions: 1- How can i combine these 2 functions? 2- If i can combine, is that a good way to combine these 2 functions if we consider the performance? I mean with 10.000 or more records.
via Levent Oner
No comments:
Post a Comment