Skip to content

Commit

Permalink
GODRIVER-2589 Clarify *Cursor.All() behavior in comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Sep 11, 2024
1 parent 8dc4e78 commit e24b5fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mongo/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ func (c *Cursor) Close(ctx context.Context) error {
}

// All iterates the cursor and decodes each document into results. The results parameter must be a pointer to a slice.
// The slice pointed to by results will be completely overwritten. This method will close the cursor after retrieving
// all documents. If the cursor has been iterated, any previously iterated documents will not be included in results.
// The slice pointed to by results will be completely overwritten. A nil slice pointer will not be modified if the cursor
// has been closed or exhausted. This method will close the cursor after retrieving all documents. If the cursor has been
// iterated, any previously iterated documents will not be included in results.
//
// This method requires driver version >= 1.1.0.
func (c *Cursor) All(ctx context.Context, results interface{}) error {
Expand Down

0 comments on commit e24b5fa

Please sign in to comment.