Skip to content

DRAFT: Next&Previous support#156

Closed
Meldiron wants to merge 1 commit intomainfrom
feat-next-and-previous
Closed

DRAFT: Next&Previous support#156
Meldiron wants to merge 1 commit intomainfrom
feat-next-and-previous

Conversation

@Meldiron
Copy link
Contributor

@Meldiron Meldiron commented Jul 21, 2022

DRAFT PR!

I believe it is possible to figure out if the query has the next and previous document within one existing query we currently do.

I got stuck on cursor pagination, tho it should be possible since we compare internal integer IDs anyway.

This answer makes me think it is possible: https://stackoverflow.com/questions/71699810/it-is-possible-in-cursor-based-pagination-to-get-the-prev-and-next-cursor-in-the

  • limit + 1 should give next document
  • <= instead of < in cursor condition should give previous document

@Meldiron
Copy link
Contributor Author

Closing the PR as this is most likely not possible due to sorting while using cursor.

@Meldiron Meldiron closed this Jul 25, 2022
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

Successfully merging this pull request may close these issues.

1 participant