0.0.8 • Published 6 years ago

mongoose-paginate-helper v0.0.8

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

mongoose-paginate-helper

A simple helper to query MongoDB using a paging-like fashion.

Loading helper

const helper = require('mongoose-paginate-helper');

The helper identifier now contains the only exported function with function firm:

async function (model, query, options);

Arguments specification.

/**
 * Pagination helper.
 * @param {Object} model Mongoose model's object, used interface of it.
 * @param {Object} query object query to perform.
 * @param {Object} options additional data
 * @param {Number} options.limit amount of results to retrieve.
 * @param {Boolean} options.lean when to perform lean queries.
 * @param {Object} options.fieldOrdering key-value pairs indicating results sorting.
 * @param {Object} options.select fields to project.
 * @param {Number} options.ordering use when _id base sorting, -1=desc 1=asc
 * @param {String} options.cursor id value from which start result retrieving.
 * @returns {Object} { list: [{}], cursor: 'string' }
 */
0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago