mongodb-paginate

JSON →
library 1.4.0 ·javascript
verified Jun 7, 2026

A library for MongoDB aggregation with built-in pagination, using the $facet operator to efficiently combine filtering, counting, and data retrieval in a single query. Version 1.4.0 supports raw MongoDB, Mongoose, and TypeScript. It organizes pipelines into pre-paging (filters), facet (count + data split), and post-paging (lookups/expensive ops) stages to minimize pipeline size early. Differentiates from mongoose-paginate by focusing on aggregation pipelines rather than simple find queries.