Skip to content

Commit

Permalink
MOTOR-842 Support 'let' option for multiple CRUD commands (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Apr 25, 2022
1 parent 7822d93 commit eb3ed14
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions motor/docstrings.py
Expand Up @@ -314,13 +314,17 @@ async def clear_collection():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
:Returns:
- An instance of :class:`~pymongo.results.DeleteResult`.
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down Expand Up @@ -348,13 +352,17 @@ async def clear_collection():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
:Returns:
- An instance of :class:`~pymongo.results.DeleteResult`.
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down Expand Up @@ -460,6 +468,10 @@ async def delete_and_return_x():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
- `**kwargs` (optional): additional command arguments can be passed
as keyword arguments (for example maxTimeMS can be used with
Expand All @@ -471,7 +483,7 @@ async def delete_and_return_x():
to using the default write concern.
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down Expand Up @@ -535,6 +547,10 @@ async def replace_one_doc():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
- `**kwargs` (optional): additional command arguments can be passed
as keyword arguments (for example maxTimeMS can be used with
Expand All @@ -546,7 +562,7 @@ async def replace_one_doc():
to using the default write concern.
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down Expand Up @@ -656,6 +672,10 @@ async def set_done():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
- `**kwargs` (optional): additional command arguments can be passed
as keyword arguments (for example maxTimeMS can be used with
Expand All @@ -668,7 +688,7 @@ async def set_done():
be slower compared to using the default write concern.
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down Expand Up @@ -880,6 +900,10 @@ async def insert_x():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
:Returns:
Expand All @@ -889,7 +913,7 @@ async def insert_x():
**>= 3.2**
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down Expand Up @@ -943,6 +967,10 @@ async def add_3_to_x():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
:Returns:
Expand All @@ -952,7 +980,7 @@ async def add_3_to_x():
**>= 3.2**
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down Expand Up @@ -1006,6 +1034,10 @@ async def add_3_to_x():
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`, created with
:meth:`~MotorClient.start_session`.
- `let` (optional): Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
- `comment` (optional): A user-provided comment to attach to this command.
:Returns:
Expand All @@ -1015,7 +1047,7 @@ async def add_3_to_x():
**>= 3.2**
.. versionchanged:: 3.0
Added ``comment`` parameter.
Added ``let`` and ``comment`` parameters.
.. versionchanged:: 2.2
Added ``hint`` parameter.
.. versionchanged:: 1.2
Expand Down

0 comments on commit eb3ed14

Please sign in to comment.