edwardhotchkiss / mongoose-paginate

Mongoose.js (Node.js & MongoDB) Document Query Pagination
MIT License
984 stars 217 forks source link

Possibility to deactivate pagination #127

Open nncl opened 6 years ago

nncl commented 6 years ago

I got a request to disable the pagination if some query is passed through the URL, so would be awesome if mongoose-paginate had this feature. I thought in something like this:

let options = {"page" : 1, "limit" : 10, "active" : false} // active default is true

I simply don't want to do this:

if (req.query.paginate) {
 Users.paginate({...})
} else {
 Users.find({...})
}

Thanks