Skip to content

Commit

Permalink
Merge branch 'release/1.11' of github.com:mongodb/mongo-go-driver int…
Browse files Browse the repository at this point in the history
…o release/1.11
  • Loading branch information
prestonvasquez committed Aug 2, 2023
2 parents abf0b71 + c7b372f commit 91d5551
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mongo/change_stream.go
Expand Up @@ -524,6 +524,16 @@ func (cs *ChangeStream) ID() int64 {
return cs.cursor.ID()
}

// SetBatchSize sets the number of documents to fetch from the database with
// each iteration of the ChangeStream's "Next" or "TryNext" method. This setting
// only affects subsequent document batches fetched from the database.
func (cs *ChangeStream) SetBatchSize(size int32) {
// Set batch size on the cursor options also so any "resumed" change stream
// cursors will pick up the latest batch size setting.
cs.cursorOptions.BatchSize = size
cs.cursor.SetBatchSize(size)
}

// Decode will unmarshal the current event document into val and return any errors from the unmarshalling process
// without any modification. If val is nil or is a typed nil, an error will be returned.
func (cs *ChangeStream) Decode(val interface{}) error {
Expand Down

0 comments on commit 91d5551

Please sign in to comment.