waterline-paginator
paginator for waterline models
Installation
$ npm install --save waterline-paginator
Usage
var waterlinePaginator = ; // Model Uservar User = connection: 'default' identity: 'user' schema: true tableName: 'area' autoCreatedAt: false autoUpdatedAt: false attributes: name: 'string' type: 'string' logo: model: 'image' ; // Model Imagevar Image = connection: 'default' identity: 'image' schema: true tableName: 'area' autoCreatedAt: false autoUpdatedAt: false attributes: hash: 'string' url: 'string' ; // Pagination Optionsvar options = model: User conditions: name: 'eric' type: 'employee' page: 1 limit: 10 sorts: 'id asc' 'name desc' populates: 'logo' 'user' // For Image Fetching linkKey: key: 'logo' item: 'logo' imageModel: UserLogo; // Invocation of paginationwaterlinePaginator;
paginatedList
is what you will get as the paginated result.
License
Apache-2.0 © calidion