mongoose-simple-paging

0.0.5 • Public • Published

Mongoose Simple Paging

NPM version Dependency Status

Install

$ npm install mongoose-simple-paging

Example

require('mongoose-simple-paging');

var page = req.query.page;
var query = MyModel.find();

query.paginate(page, limit,function(err, docs,pagination) {

  //docs  - documents,
  //pagination{
    //totalRows
    //totalPages
    //limit
    //current
    //hasNextPage
    //nextPage
    //hasPreviousPage
    //prevPage
    //hasPagination
    //startRow
    //endRow
    //pages

  //}
});

TODO

Test

License

The MIT License (MIT)

Package Sidebar

Install

npm i mongoose-simple-paging

Weekly Downloads

2

Version

0.0.5

License

MIT

Last publish

Collaborators

  • nicowap