Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Aug 30, 2024
1 parent 4897d97 commit d503a13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions mongo/bulk_write_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ func (uom *UpdateOneModel) SetUpsert(upsert bool) *UpdateOneModel {
return uom
}

// SetSort specifies which document the operation updates if the query matches multiple documents.
// The first document matched by the sort order will be updated.
// SetSort specifies which document the operation updates if the query matches multiple documents. The first document
// matched by the sort order will be updated. This option is only valid for MongoDB versions >= 8.0. The driver will
// return an error if the sort parameter is a multi-key map. The default value is nil.
func (uom *UpdateOneModel) SetSort(sort interface{}) *UpdateOneModel {
uom.Sort = sort
return uom
Expand Down
1 change: 0 additions & 1 deletion testdata/crud/unified/bulkWrite-updateOne-sort.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
"description": "BulkWrite updateOne with sort option unsupported (server-side error)",
"runOnRequirements": [
{
"minServerVersion": "4.2.0",
"maxServerVersion": "7.99"
}
],
Expand Down
3 changes: 1 addition & 2 deletions testdata/crud/unified/bulkWrite-updateOne-sort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ tests:
x: 1
- description: BulkWrite updateOne with sort option unsupported (server-side error)
runOnRequirements:
- minServerVersion: 4.2.0
maxServerVersion: "7.99"
- maxServerVersion: "7.99"
operations:
- object: collection0
name: bulkWrite
Expand Down

0 comments on commit d503a13

Please sign in to comment.