[SERVER-41145] Change streams Created: 14/May/19  Updated: 18/Sep/19  Resolved: 24/Jun/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.0.1
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Anton Vakulenko Assignee: Eric Sedor
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Is there any possibility to apply limit and offset for MongoDB change streams feature?

I have an application with pagination support and I wanted to ask if there any way to watch only for changes of records that displayed on the front-end for current page (using offset and limit)



 Comments   
Comment by NOVALUE Mitar [ 18/Sep/19 ]

I also think this (together with $sort aggregation pipeline step) would be very useful. In this way I can then make a reactive query: fetch documents on the first page of results for a given $match, and display them to the user, updating them if any value in those documents change. If user goes to the second page (or loads the second page in infinity scroll) then I would increase the limit or offset, while keeping $sort.

 

Comment by Eric Sedor [ 24/Jun/19 ]

Hi,

We haven’t heard back from you for some time, so I’m going to mark this ticket as resolved. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Regards,
Eric

Comment by Eric Sedor [ 29/May/19 ]

Hi antonvakulenko93, we hadn't heard from you in a while but wanted to see if you were able to clarify your request.

Sincerely,
Eric

Comment by Eric Sedor [ 15/May/19 ]

antonvakulenko93,

Here is a list of what is currently supported.

It should be possible to open a change stream on a set of documents using $match, independent of how that set of documents was obtained.

Because the documents returned via a query can change over time, including with respect to what skip/limit "page" a specific document is on, it is difficult to formulate how skip and limit would make sense as part of a Change Stream pipeline.

But it will help us reason about a feature like this if you can elaborate more on the exact use-case you are considering.

It might also be helpful if you can propose the specific operations and results you'd like to see.

Thank you!

Generated at Thu Feb 08 04:56:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.