#mongo-db #cursor #pagination #nodejs

mongodb-cursor-pagination

Provides cursor based pagination for the native MongoDB driver in Rust

12 releases

1.0.0-rc.1 May 22, 2023
0.3.2 May 7, 2023
0.2.9 Aug 11, 2020
0.2.8 May 2, 2020
0.1.0 Jan 16, 2020

#801 in Database interfaces

Download history 22/week @ 2024-01-08 17/week @ 2024-01-15 52/week @ 2024-01-22 5/week @ 2024-01-29 143/week @ 2024-02-05 77/week @ 2024-02-12 49/week @ 2024-02-19 48/week @ 2024-02-26 19/week @ 2024-03-04 50/week @ 2024-03-11 159/week @ 2024-03-18 30/week @ 2024-03-25 225/week @ 2024-04-01

465 downloads per month
Used in 2 crates

MIT license

25KB
432 lines

MongoDB Cursor Pagination

Crate Docs Build Status MIT licensed

Documentation
Examples

This package provides a cursor based pagination using the mongodb driver. Essentially instead of page based pagination you receive cursors to both the start and end of the result set so that you can ensure you get the next item, even if the data changes in between requests. That said, it also provides regular ole' page based pagination as well. If your options include skip and limit parameters then you'll do the page based. If you leave skip off or send a cursor, then it will use that instead (and ignore the skip parameter.)

It's based on the node.js module but written in Rust. You can read more about the concept on their blog post.

So far it only supports find. Search and aggregation will come when needed.

Dependencies

~25–39MB
~765K SLoC