0.0.2 • Published 10 years ago

loopback-datasource-juggler-paginate v0.0.2

Weekly downloads
12
License
-
Repository
github
Last release
10 years ago

loopback-datasource-juggler-paginate

Loopback Datasource Juggler plugin that adds findPaginate method to Model.

Currently expects query params as given by ng-table, and provides an object intended to be used by the same.

Usage

/**
  *
  * @param {Object} Query params
  * @param {[Object]} Optional query to be lodash.extend'ed onto the pagination query
  * @return {Promise}
  */
Model.findPaginate(req.query, {
  where: {
    status: {
      neq: 'Deleted'
    }
  }
}).then(function(models) {
  console.log(models);
});

1 https://github.com/esvit/ng-table