File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 61
61
)
62
62
63
63
// ChangeStream is used to iterate over a stream of events. Each event can be decoded into a Go type via the Decode
64
- // method or accessed as raw BSON via the Current field. For more information about change streams, see
64
+ // method or accessed as raw BSON via the Current field. This type is not goroutine safe and must not be used
65
+ // concurrently by multiple goroutines. For more information about change streams, see
65
66
// https://docs.mongodb.com/manual/changeStreams/.
66
67
type ChangeStream struct {
67
68
// Current is the BSON bytes of the current event. This property is only valid until the next call to Next or
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ import (
21
21
)
22
22
23
23
// Cursor is used to iterate over a stream of documents. Each document can be decoded into a Go type via the Decode
24
- // method or accessed as raw BSON via the Current field.
24
+ // method or accessed as raw BSON via the Current field. This type is not goroutine safe and must not be used
25
+ // concurrently by multiple goroutines.
25
26
type Cursor struct {
26
27
// Current contains the BSON bytes of the current change document. This property is only valid until the next call
27
28
// to Next or TryNext. If continued access is required, a copy must be made.
You can’t perform that action at this time.
0 commit comments