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 @@ -527,6 +527,16 @@ func (cs *ChangeStream) ID() int64 {
527527 return cs .cursor .ID ()
528528}
529529
530+ // SetBatchSize sets the number of documents to fetch from the database with
531+ // each iteration of the ChangeStream's "Next" or "TryNext" method. This setting
532+ // only affects subsequent document batches fetched from the database.
533+ func (cs * ChangeStream ) SetBatchSize (size int32 ) {
534+ // Set batch size on the cursor options also so any "resumed" change stream
535+ // cursors will pick up the latest batch size setting.
536+ cs .cursorOptions .BatchSize = size
537+ cs .cursor .SetBatchSize (size )
538+ }
539+
530540// Decode will unmarshal the current event document into val and return any errors from the unmarshalling process
531541// without any modification. If val is nil or is a typed nil, an error will be returned.
532542func (cs * ChangeStream ) Decode (val interface {}) error {
You can’t perform that action at this time.
0 commit comments