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 {
527
527
return cs .cursor .ID ()
528
528
}
529
529
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
+
530
540
// Decode will unmarshal the current event document into val and return any errors from the unmarshalling process
531
541
// without any modification. If val is nil or is a typed nil, an error will be returned.
532
542
func (cs * ChangeStream ) Decode (val interface {}) error {
You can’t perform that action at this time.
0 commit comments