[SERVER-35030] Add 'startAfter' option to the $changeStream stage Created: 16/May/18  Updated: 29/Oct/23  Resolved: 20/Jun/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.1.1

Type: New Feature Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-544 Support 'startAfter' option to the $c... Closed
Documented
is documented by DOCS-11828 Docs for SERVER-35030: Add 'startAfte... Closed
Related
Backwards Compatibility: Fully Compatible
Sprint: Query 2018-06-04, Query 2018-06-18, Query 2018-07-02
Participants:

 Description   

Similar to 'resumeAfter', this option takes a resume token and starts a new change stream returning the first notification after the token.

This will allow users to watch collections that have been dropped and recreated or newly renamed collections without missing any notifications.



 Comments   
Comment by Nicholas Zolnierz [ 31/Jul/18 ]

jmikola, the two options are very similar but there's a subtle difference around resuming/starting from an "invalidate" token. For resumeAfter, the idea is that you should not be able to resume a stream if you've already received an invalidate. Attempting to do so will result in an error.

However, startAfter is meant to indicate that a new stream is being created, so using the token from an "invalidate" notification is valid. Please see SERVER-34789 for more details on the behavior and let me know if you have any other questions.

Comment by Jeremy Mikola [ 31/Jul/18 ]

nicholas.zolnierz: Looking at the commit, it appears that startAfter is an alias for resumeAfter with a prohibition against using both options at the same time. Was this implemented simply to make the original resumeAfter option to consistent with startAfterOperationTime from MongoDB 4.0?

Comment by Githook User [ 20/Jun/18 ]

Author:

{'username': 'nzolnierzmdb', 'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com'}

Message: SERVER-35030: Add 'startAfter' option to the $changeStream stage
Branch: master
https://github.com/mongodb/mongo/commit/43f8fc8c45b854c192f39368f843352c479008f5

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