@@ -258,8 +258,8 @@ func (f *FindOptionsBuilder) SetSkip(i int64) *FindOptionsBuilder {
258
258
}
259
259
260
260
// SetSort sets the value for the Sort field. Sort is a document specifying the order in which
261
- // documents should be returned. The driver will return an error if the sort parameter is a
262
- // multi-key map.
261
+ // documents should be returned. The sort parameter is evaluated sequentially, so the driver will
262
+ // return an error if it is a multi-key map (which is unordeded). The default value is nil .
263
263
func (f * FindOptionsBuilder ) SetSort (sort interface {}) * FindOptionsBuilder {
264
264
f .Opts = append (f .Opts , func (opts * FindOptions ) error {
265
265
opts .Sort = sort
@@ -426,8 +426,9 @@ func (f *FindOneOptionsBuilder) SetSkip(i int64) *FindOneOptionsBuilder {
426
426
}
427
427
428
428
// SetSort sets the value for the Sort field. Sets a document specifying the sort order to
429
- // apply to the query. The first document in the sorted order will be returned. The driver
430
- // will return an error if the sort parameter is a multi-key map.
429
+ // apply to the query. The first document in the sorted order will be returned. The sort
430
+ // parameter is evaluated sequentially, so the driver will return an error if it is a multi-
431
+ // key map (which is unordeded). The default value is nil.
431
432
func (f * FindOneOptionsBuilder ) SetSort (sort interface {}) * FindOneOptionsBuilder {
432
433
f .Opts = append (f .Opts , func (opts * FindOneOptions ) error {
433
434
opts .Sort = sort
@@ -539,8 +540,9 @@ func (f *FindOneAndReplaceOptionsBuilder) SetReturnDocument(rd ReturnDocument) *
539
540
540
541
// SetSort sets the value for the Sort field. Sets a document specifying which document should
541
542
// be replaced if the filter used by the operation matches multiple documents in the collection.
542
- // If set, the first document in the sorted order will be replaced. The driver will return an
543
- // error if the sort parameter is a multi-key map. The default value is nil.
543
+ // If set, the first document in the sorted order will be replaced. The sort parameter is evaluated
544
+ // sequentially, so the driver will return an error if it is a multi-key map (which is unordeded).
545
+ // The default value is nil.
544
546
func (f * FindOneAndReplaceOptionsBuilder ) SetSort (sort interface {}) * FindOneAndReplaceOptionsBuilder {
545
547
f .Opts = append (f .Opts , func (opts * FindOneAndReplaceOptions ) error {
546
548
opts .Sort = sort
@@ -716,8 +718,9 @@ func (f *FindOneAndUpdateOptionsBuilder) SetReturnDocument(rd ReturnDocument) *F
716
718
717
719
// SetSort sets the value for the Sort field. Sets a document specifying which document should
718
720
// be updated if the filter used by the operation matches multiple documents in the collection.
719
- // If set, the first document in the sorted order will be updated. The driver will return an
720
- // error if the sort parameter is a multi-key map. The default value is nil.
721
+ // If set, the first document in the sorted order will be updated. The sort parameter is evaluated
722
+ // sequentially, so the driver will return an error if it is a multi-key map (which is unordeded).
723
+ // The default value is nil.
721
724
func (f * FindOneAndUpdateOptionsBuilder ) SetSort (sort interface {}) * FindOneAndUpdateOptionsBuilder {
722
725
f .Opts = append (f .Opts , func (opts * FindOneAndUpdateOptions ) error {
723
726
opts .Sort = sort
@@ -846,8 +849,9 @@ func (f *FindOneAndDeleteOptionsBuilder) SetProjection(projection interface{}) *
846
849
847
850
// SetSort sets the value for the Sort field. Sets a document specifying which document should
848
851
// be replaced if the filter used by the operation matches multiple documents in the collection.
849
- // If set, the first document in the sorted order will be selected for replacement. The driver
850
- // will return an error if the sort parameter is a multi-key map. The default value is nil.
852
+ // If set, the first document in the sorted order will be deleted. The sort parameter is evaluated
853
+ // sequentially, so the driver will return an error if it is a multi-key map (which is unordeded).
854
+ // The default value is nil.
851
855
func (f * FindOneAndDeleteOptionsBuilder ) SetSort (sort interface {}) * FindOneAndDeleteOptionsBuilder {
852
856
f .Opts = append (f .Opts , func (opts * FindOneAndDeleteOptions ) error {
853
857
opts .Sort = sort
0 commit comments