File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -524,6 +524,16 @@ func (cs *ChangeStream) ID() int64 {
524524 return cs .cursor .ID ()
525525}
526526
527+ // SetBatchSize sets the number of documents to fetch from the database with
528+ // each iteration of the ChangeStream's "Next" or "TryNext" method. This setting
529+ // only affects subsequent document batches fetched from the database.
530+ func (cs * ChangeStream ) SetBatchSize (size int32 ) {
531+ // Set batch size on the cursor options also so any "resumed" change stream
532+ // cursors will pick up the latest batch size setting.
533+ cs .cursorOptions .BatchSize = size
534+ cs .cursor .SetBatchSize (size )
535+ }
536+
527537// Decode will unmarshal the current event document into val and return any errors from the unmarshalling process
528538// without any modification. If val is nil or is a typed nil, an error will be returned.
529539func (cs * ChangeStream ) Decode (val interface {}) error {
You can’t perform that action at this time.
0 commit comments