Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Mongoose.js (Node.js & MongoDB) Document Query Pagination

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples/basic
lib
test
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
package.json

README.md

mongoose-paginate - Build Status

Mongoose ORM (NodeJS/MongoDB) Document Query Pagination

Installation

$ npm install mongoose-paginate

Usage

/**
 * basic example usage of `mongoose-pagination`
 * querying for `all` {} items in `MyModel`
 * paginating by second page, 10 items per page (10 results, page 2)
 **/

var paginate = require('mongoose-paginate');

MyModel.paginate({}, 2, 10, function(error, pageCount, paginatedResults) {
  if (error) {
    console.error(error);
  } else {
    console.log('Pages:', pageCount);
    console.log(paginatedResults);
  }
}

/* EOF */

Run Tests

$ npm test

Author: Edward Hotchkiss

Something went wrong with that request. Please try again.