HF RL Explorer

MongoDB Pagination with Total Count Optimization

MongoDB Pagination with Total Count Optimization: a task in Terminal-Lego-15k (Harbor dataset). You need to implement an optimized pagination solution for MongoDB that retrieves both a limited subset of documents and the total count of matching documents in a single, efficient operation. This is a…

The task

You need to implement an optimized pagination solution for MongoDB that retrieves both a limited subset of documents and the total count of matching documents in a single, efficient operation. This is a common requirement for building paginated APIs where clients need to know the total number of pages available.

Part of PrimeIntellect/Terminal-Lego-15k.