@@ -389,6 +389,11 @@ def delete_one(opts = {})
389389 # @option opts [ true, false ] :upsert Whether to upsert if the
390390 # document doesn't exist.
391391 # Can be :w => Integer, :fsync => Boolean, :j => Boolean.
392+ # @option opts [ Hash ] :sort Specifies which document the operation
393+ # replaces if the query matches multiple documents. The first document
394+ # matched by the sort order will be replaced.
395+ # This option is only supported by servers >= 8.0. Older servers will
396+ # report an error for using this option.
392397 #
393398 # @return [ Result ] The response from the database.
394399 #
@@ -410,6 +415,7 @@ def replace_one(replacement, opts = {})
410415 Operation ::U => replacement ,
411416 hint : opts [ :hint ] ,
412417 collation : opts [ :collation ] || opts [ 'collation' ] || collation ,
418+ sort : opts [ :sort ] || opts [ 'sort' ] ,
413419 } . compact
414420 if opts [ :upsert ]
415421 update_doc [ 'upsert' ] = true
@@ -549,6 +555,11 @@ def update_many(spec, opts = {})
549555 # document doesn't exist.
550556 # @option opts [ Hash ] :write_concern The write concern options.
551557 # Can be :w => Integer, :fsync => Boolean, :j => Boolean.
558+ # @option opts [ Hash ] :sort Specifies which document the operation
559+ # updates if the query matches multiple documents. The first document
560+ # matched by the sort order will be updated.
561+ # This option is only supported by servers >= 8.0. Older servers will
562+ # report an error for using this option.
552563 #
553564 # @return [ Result ] The response from the database.
554565 #
@@ -570,6 +581,7 @@ def update_one(spec, opts = {})
570581 Operation ::U => spec ,
571582 hint : opts [ :hint ] ,
572583 collation : opts [ :collation ] || opts [ 'collation' ] || collation ,
584+ sort : opts [ :sort ] || opts [ 'sort' ] ,
573585 } . compact
574586 if opts [ :upsert ]
575587 update_doc [ 'upsert' ] = true
0 commit comments