{"repo":"aravindnc/mongoose-aggregate-paginate-v2","free":true,"listed":false,"github":"https://github.com/aravindnc/mongoose-aggregate-paginate-v2","clone":"git clone https://github.com/aravindnc/mongoose-aggregate-paginate-v2.git","description":"A page based custom aggregate pagination library for Mongoose with customizable labels.","language":"JavaScript","stars":140,"topics":["pagination","paginate","paging","aggregate","next","prev","total","paginator","mongoose","mongodb"],"license":"MIT","category":"data-pipelines","readme_excerpt":"mongoose-aggregate-paginate-v2 A page based custom aggregate pagination library for Mongoose with customizable labels. If you are looking for basic query pagination library without aggregate, use this one mongoose-paginate-v2 Installation Usage Adding the plugin to a schema, and then use model aggregatePaginate method, Model.aggregatePaginate([aggregateQuery], [options], [callback]) Returns promise Parameters - [aggregate-query] {Object} - Aggregate Query criteria. Documentation - [options] {Object} - [sort] {Object String} - Sort order. Documentation - [offset=0] {Number} - Use offset or page to set skip position - [page] {Number} - Current Page (Defaut: 1) - [limit] {Number} - Docs. per page (Default: 10). - [customLabels] {Object} - Developers can provide custom labels for manipulating the response data. - [pagination] {Boolean} - If pagination is set to false, it will return all docs without adding limit condition. (Default: True) - [allowDiskUse] {Bool} - To enable diskUse for bigger queries. (Default: False) - [countQuery] {Object} - Aggregate Query used to count the resultant documents. Can be used for bigger queries. (Default: aggregate-query ) - [useFacet] {Bool} - To use facet operator instead of using two queries. This is the new default. (Default: true) - [callback(err, result)] - (Optional) If specified the callback is called once pagination results are retrieved or when an error has occurred. Return value Promise fulfilled with object having properties: - docs {","default_branch":null,"files":null,"tree":[],"storefront":"/r/aravindnc","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/aravindnc/mongoose-aggregate-paginate-v2/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}