mongoose-ranged-paginate
v0.1.0
Published
Mongoose ORM Document Query Pagination based on range query
Downloads
3
Maintainers
Readme
mongoose-ranged-paginate
Mongoose ORM Document Pagination Based on Ranged Query
Features
- next_max_id
- count
Installation
$ npm install mongoose-ranged-paginate
Usage
To get 20 MyModels started from 1cdfb22e1f3c000000003152
,
require('mongoose-ranged-paginate')
MyModel.find()
.sort('-_id')
.paginate(20, '1cdfb22e1f3c000000003152')
.exec(function (err, models) {
};
To get 20 latest MyModels
require('mongoose-ranged-paginate')
MyModel.find()
.paginate(20)
.exec(function (err, models) {
};
Or set default count via paginate.count
paginate = require('mongoose-ranged-paginate')
paginate.count = 20
MyModel.find()
.paginate()
.exec(function (err, models) {
};
Contribution
Run Tests
$ npm test
Any contribution is more then welcome!