Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

branch: master
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);
  }
});

Run Tests

$ npm test

Author: Edward Hotchkiss

Bitdeli Badge

Something went wrong with that request. Please try again.