Skip to content

Commit 79d579d

Browse files
committed
Documentation and argument name updates
1 parent 1807a60 commit 79d579d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/mongo/collection.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def count(filter = nil, options = {})
210210
#
211211
# @option options [ Integer ] :max_time_ms The maximum amount of time to allow the command to run.
212212
#
213-
# @return [ Integer ] The document count.
213+
# @return [ Array<Object> ] The list of distinct values.
214214
#
215215
# @since 2.1.0
216216
def distinct(field_name, filter = nil, options = {})
@@ -289,6 +289,11 @@ def insert_many(documents, options = {})
289289
# @param [ Array<Hash> ] operations The operations.
290290
# @param [ Hash ] options The options.
291291
#
292+
# @option options [ true, false ] :ordered Whether the operations
293+
# should be executed in order.
294+
# @option options [ Hash ] :write_concern The write concern options.
295+
# Can be :w => Integer, :fsync => Boolean, :j => Boolean.
296+
#
292297
# @return [ BulkWrite::Result ] The result of the operation.
293298
#
294299
# @since 2.0.0
@@ -410,7 +415,7 @@ def find_one_and_delete(filter, opts = {})
410415
# collection.find_one_and_update({ name: 'test' }, { "$set" => { name: 'test1' }}, :return_document => :before)
411416
#
412417
# @param [ Hash ] filter The filter to use.
413-
# @param [ BSON::Document ] document The update statement.
418+
# @param [ BSON::Document ] update The update statement.
414419
# @param [ Hash ] opts The options.
415420
#
416421
# @option opts [ Integer ] :max_time_ms The maximum amount of time to allow the command
@@ -426,8 +431,8 @@ def find_one_and_delete(filter, opts = {})
426431
# @return [ BSON::Document ] The document.
427432
#
428433
# @since 2.1.0
429-
def find_one_and_update(filter, document, opts = {})
430-
find(filter, opts).find_one_and_update(document, opts)
434+
def find_one_and_update(filter, update, opts = {})
435+
find(filter, opts).find_one_and_update(update, opts)
431436
end
432437

433438
# Finds a single document and replaces it.
@@ -439,7 +444,7 @@ def find_one_and_update(filter, document, opts = {})
439444
# collection.find_one_and_replace({ name: 'test' }, { name: 'test1' }, :return_document => :after)
440445
#
441446
# @param [ Hash ] filter The filter to use.
442-
# @param [ BSON::Document ] document The replacement.
447+
# @param [ BSON::Document ] replacement The replacement document.
443448
# @param [ Hash ] opts The options.
444449
#
445450
# @option opts [ Integer ] :max_time_ms The maximum amount of time to allow the command

0 commit comments

Comments
 (0)