-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Change Streams
-
None
-
Not Needed
-
Currently you can set batch size on a ChangeStream using ChangeStreamOptions.SetBatchSize. However, that applies to both the initial "aggregate" command as well as the subsequent "getMore" commands run while iterating the change stream. That can cause a problem when starting a change stream on low- or bursty-traffic collections because the initial aggregate won't return a cursor until the batch size is filled. The tailable cursor used by a change stream is intended to wait indefinitely for updates, but the initial "aggregate" command isn't, so will time out if there aren't enough changes to fill a batch, leading to an unexpected error.
Definition of done:
- Allow setting batch size on a ChangeStream after it's returned by Watch.