How do I Perform Pagination Using Webhook?

I want to Perform Pagination using MongoDB Webhook. Which means i want next 10 records each time when i call webhook.

For best practices on pagination in MongoDB, check out Paging with the Bucket Pattern - Part 1 | MongoDB Blog. It will walk you through how to use the Bucket Pattern for pagination.

You should be able to apply those practices when creating a webhook. See https://docs.mongodb.com/realm/services/configure/service-webhooks/ for more information on creating webhooks

Did the 2021 MongoDB live talk about new or current ways to paginate results.

The link mentioned above which talks about the bucket pattern assumes that we are free to restructure our existing data, but what happens if we already have data that is structured in a way and cant be changed, we still need to use the limit, sort and skip. Was this discussed in the 2021 talks?

Also when you mentioned webhooks my guess is that you are talking about realm webhooks? mongodb atlas does not have web hooks do they? only function triggers, are there webhooks i can call directly that will perform a action? right now we have to call our server which in turns calls the mongodb database on atlas.

Thanks.

Hi @Rishi_uttam,

I’m not aware of any MongoDB.live talks that hit on this specifically. There was a Schema Design Ask Me Anything talk, but I’m not sure if they got into pagination: Schema Design - Ask me Anything - YouTube

Here is another article on pagination that you might find helpful: MongoDB Pagination, Fast & Consistent | by Mosius | The Startup | Medium

Yes, I was referencing Realm webhooks. You can create a Realm app and associate it with an Atlas cluster, so, if your data is in Atlas, you should be able to create an associated webhook.