MongoDB Cursor Pagination

JSON →
library 1.10.0 ·javascript
verified Jun 7, 2026

Cursor-based pagination for MongoDB collections, written in TypeScript. v1.10.0 (stable, actively maintained) follows the Relay cursor connection spec, providing cursor-based pagination as a more stable alternative to offset-based pagination (which can miss/duplicate items when data changes between pages). The package ships TypeScript types and offers two main functions: `findPaginated` for simple queries and `aggregatePaginated` for aggregation pipelines. Based on mongo-cursor-pagination but with a cleaner API that returns standard pagination metadata (hasNextPage, hasPreviousPage, startCursor, endCursor). Peer dependency on mongodb driver 6.x.