JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13605
  • Score
    100M100P100Q133193F

Mongoose ORM (NodeJS/MongoDB) Document Query Pagination

Package Exports

  • mongoose-paginate

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mongoose-paginate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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 mongoose = 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