[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: |
|
||||||||||||||||||||
| 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 |
| 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: |