Skip to content

Commit

Permalink
GODRIVER-2930 Allow setting batch size for subsequent getMore's on a …
Browse files Browse the repository at this point in the history
…ChangeStream.
  • Loading branch information
matthewdale committed Aug 2, 2023
1 parent 4acd551 commit 19b0e61
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mongo/change_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,13 @@ 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) {
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 19b0e61

Please sign in to comment.