-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cosmos SDK v4 - Pagination based on continuation token #14675
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wmengmsft, @MehaKaushik, @shurd, @anfeldma-ms |
Thanks for filing this Cosmos v4 sdk issue, @rkganji. Someone from the /cc @kushagraThapar |
@rkganji - can you please share the query that you are running ? |
@kushagraThapar Query based on our project schema look like below (Basically, search reservations in a certain timeframe)
|
@rkganji - how are you using the |
@kushagraThapar Our API returns the continuation token to our internal client along with results. Clients iteratively calls our API by passing continuation token returned by our API until there's no continuation token available. Basically, clients iteratively call our API to get all the results in a paginated way. If we do below, things work fine as we are getting all results in one shot and there's no pagination as such:
|
I see, makes sense. What version of SDK are you using ? |
We are using 4.3.0 |
@kushagraThapar Great, Thanks for the update |
@rkganji - can you please confirm if this fixes your issue ? |
@kushagraThapar On trying to integrate with v4.8.0, I get below error when initialising CosmosClient. I don't get this issue on 4.7.1 or 4.7.0. Something underlying changed?
|
@rkganji - thanks for the stack trace, looks like a netty dependency issue. I will investigate this. |
@rkganji - I verified the netty versions issues from Cosmos SDK side, and I don't see any issues there. |
@kushagraThapar May be some version mismatch running from functions runtime. I will investigate this. |
@kushagraThapar Netty issue that I reported is due to Azure/azure-functions-java-worker#381 which I was able to resolve by upgrading azure functions core tools and using FUNCTIONS_WORKER_JAVA_LOAD_APP_LIBS as mentioned to override class loading behaviour for azure functions. I tested the pagination fix and found to be working fine now. |
@rkganji - thanks for the verification, closing this issue now. |
We have a requirement for clients to get results in paginated way. Pagination was implemented as below:
Issue:
This is working fine when overall result set is less e.g., 120 documents returned as 3 pages. This is not working fine when overall results set is large. When total no. of documents is ~1000, same continuationToken is being returned causing an endless loop and not able to get documents beyond initial 50 docs returned.
The text was updated successfully, but these errors were encountered: