0.0.5 • Published 8 years ago

mongoose-simple-paging v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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)