Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination returning the same keys in monger #207

Open
zendevil opened this issue Mar 12, 2021 · 0 comments
Open

Pagination returning the same keys in monger #207

zendevil opened this issue Mar 12, 2021 · 0 comments

Comments

@zendevil
Copy link

zendevil commented Mar 12, 2021

I’m doing a db query using the monger library like so:

(q/with-collection db "videos"
             (q/find {})
             (q/sort {:date 1})
             (q/paginate :page page :per-page 5))

However, when I do page 1, I get the following ids:

("6011a14028dacb0004d7475c"
"6011a1ea28dacb0004d7475d"
"60119fe128dacb0004d7475a"
"602a15665273b0b82c3ded1c"
"6011a0b428dacb0004d7475b")

when I do page 2, I get these:

("6011a14028dacb0004d7475c"
"60119fe128dacb0004d7475a"
"602a15665273b0b82c3ded1c"
"6011a0b428dacb0004d7475b"
"60124ed4afa8e90004ab71a0")

The problem is that there’s an overlap of ids between the two pages. I expect the pages to show ids with no overlap. How to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant