aggregation

2024

  • Cursor-based Pagination on Multiple Fields with MongoDB

    Cursor-based pagination can offer great performance on large datasets when an index can be used efficiently. With a single field, as cursor and sort criteria, the implementation is straight forward. Tutorials can be found all over the internet. But with multiple cursor fields, the filter criteria and sort order is not as simple, especially if an index is to be used for optimal performance.