Skip to content

Commit

Permalink
max_time_ms
Browse files Browse the repository at this point in the history
  • Loading branch information
comandeo-mongo committed Jul 5, 2024
1 parent d1bf06e commit 54a24c2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 17 deletions.
28 changes: 18 additions & 10 deletions lib/mongo/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,9 @@ def drop(opts = {})
# this command.
# @option options [ :tailable, :tailable_await ] :cursor_type The type of cursor to use.
# @option options [ Integer ] :limit The max number of docs to return from the query.
# @option options [ Integer ] :max_time_ms
# The maximum amount of time to allow the query to run, in milliseconds.
# @option options [ Integer ] :max_time_ms The maximum amount of time to
# allow the query to run, in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Hash ] :modifiers A document containing meta-operators modifying the
# output or behavior of a query.
# @option options [ true | false ] :no_cursor_timeout The server normally times out idle
Expand Down Expand Up @@ -552,8 +553,9 @@ def find(filter = nil, options = {})
# @option options [ String ] :hint The index to use for the aggregation.
# @option options [ Hash ] :let Mapping of variables to use in the pipeline.
# See the server documentation for details.
# @option options [ Integer ] :max_time_ms The maximum amount of time in
# milliseconds to allow the aggregation to run.
# @option options [ Integer ] :max_time_ms The maximum amount of time to
# allow the query to run, in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Session ] :session The session to use.
# @option options [ Integer ] :timeout_ms The operation timeout in milliseconds.
# Must be a non-negative integer. An explicit value of 0 means infinite.
Expand Down Expand Up @@ -657,7 +659,9 @@ def watch(pipeline = [], options = {})
#
# @option options [ Hash ] :hint The index to use.
# @option options [ Integer ] :limit The maximum number of documents to count.
# @option options [ Integer ] :max_time_ms The maximum amount of time to allow the command to run.
# @option options [ Integer ] :max_time_ms The maximum amount of time to
# allow the query to run, in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Integer ] :skip The number of documents to skip before counting.
# @option options [ Hash ] :read The read preference options.
# @option options [ Hash ] :collation The collation to use.
Expand Down Expand Up @@ -750,7 +754,9 @@ def estimated_document_count(options = {})
# @param [ Hash ] filter The documents from which to retrieve the distinct values.
# @param [ Hash ] options The distinct command options.
#
# @option options [ Integer ] :max_time_ms The maximum amount of time to allow the command to run.
# @option options [ Integer ] :max_time_ms The maximum amount of time to
# allow the query to run, in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Hash ] :read The read preference options.
# @option options [ Hash ] :collation The collation to use.
# @option options [ Session ] :session The session to use.
Expand Down Expand Up @@ -1001,8 +1007,9 @@ def delete_many(filter = nil, options = {})
# @param [ Integer ] cursor_count The max number of cursors to return.
# @param [ Hash ] options The parallel scan command options.
#
# @option options [ Integer ] :max_time_ms The maximum amount of time to allow the command
# to run in milliseconds.
# @option options [ Integer ] :max_time_ms The maximum amount of time to
# allow the query to run, in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Session ] :session The session to use.
# @option options [ :cursor_lifetime | :iteration ] :timeout_mode How to interpret
# :timeout_ms (whether it applies to the lifetime of the cursor, or per
Expand Down Expand Up @@ -1125,8 +1132,9 @@ def update_one(filter, update, options = {})
# @param [ Hash ] filter The filter to use.
# @param [ Hash ] options The options.
#
# @option options [ Integer ] :max_time_ms The maximum amount of time to allow the command
# to run in milliseconds.
# @option options [ Integer ] :max_time_ms The maximum amount of time to
# allow the query to run, in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Hash ] :projection The fields to include or exclude in the returned doc.
# @option options [ Hash ] :sort The key and direction pairs by which the result set
# will be sorted.
Expand Down
3 changes: 2 additions & 1 deletion lib/mongo/collection/view/aggregation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class Aggregation
# @option options [ Hash ] :let Mapping of variables to use in the pipeline.
# See the server documentation for details.
# @option options [ Integer ] :max_time_ms The maximum amount of time in
# milliseconds to allow the aggregation to run.
# milliseconds to allow the aggregation to run. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Session ] :session The session to use.
# @option options [ :cursor_lifetime | :iteration ] :timeout_mode How to interpret
# :timeout_ms (whether it applies to the lifetime of the cursor, or per
Expand Down
6 changes: 4 additions & 2 deletions lib/mongo/collection/view/readable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ module Readable
# @option options [ Hash ] :let Mapping of variables to use in the pipeline.
# See the server documentation for details.
# @option options [ Integer ] :max_time_ms The maximum amount of time in
# milliseconds to allow the aggregation to run.
# milliseconds to allow the aggregation to run. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Session ] :session The session to use.
# @option options [ Integer ] :timeout_ms The operation timeout in milliseconds.
# Must be a non-negative integer. An explicit value of 0 means infinite.
Expand Down Expand Up @@ -222,7 +223,8 @@ def count(opts = {})
# MongoDB to use a specific index for the query. Requires server version 3.6+.
# @option opts :limit [ Integer ] Max number of docs to count.
# @option opts :max_time_ms [ Integer ] The maximum amount of time to allow the
# command to run.
# command to run. This option is deprecated, use
# :timeout_ms instead.
# @option opts [ Hash ] :read The read preference options.
# @option opts [ Hash ] :collation The collation to use.
# @option opts [ Mongo::Session ] :session The session to use for the operation.
Expand Down
6 changes: 4 additions & 2 deletions lib/mongo/collection/view/writable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ module Writable
# @param [ Hash ] opts The options.
#
# @option opts [ Integer ] :max_time_ms The maximum amount of time to allow the command
# to run in milliseconds.
# to run in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option opts [ Hash ] :projection The fields to include or exclude in the returned doc.
# @option opts [ Hash ] :sort The key and direction pairs by which the result set
# will be sorted.
Expand Down Expand Up @@ -149,7 +150,8 @@ def find_one_and_replace(replacement, opts = {})
# @param [ Hash ] opts The options.
#
# @option opts [ Integer ] :max_time_ms The maximum amount of time to allow the command
# to run in milliseconds.
# to run in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option opts [ Hash ] :projection The fields to include or exclude in the returned doc.
# @option opts [ Hash ] :sort The key and direction pairs by which the result set
# will be sorted.
Expand Down
9 changes: 7 additions & 2 deletions lib/mongo/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,14 @@ def users
# @option options [ Hash ] :collation The collation to use.
# @option options [ Object ] :comment A user-provided
# comment to attach to this command.
# @option options [ Integer ] :max_time_ms The maximum amount of time to
# allow the query to run, in milliseconds. This option is deprecated, use
# :timeout_ms instead.
# @option options [ Integer ] :timeout_ms The operation timeout in milliseconds.
# Must be a non-negative integer. An explicit value of 0 means infinite.
# The default value is unset which means the value is inherited from
# the database or the client.
# @option options [ String ] :hint The index to use for the aggregation.
# @option options [ Integer ] :max_time_ms The maximum amount of time in
# milliseconds to allow the aggregation to run.
# @option options [ Session ] :session The session to use.
#
# @return [ Collection::View::Aggregation ] The aggregation object.
Expand Down

0 comments on commit 54a24c2

Please sign in to comment.