Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOTOR-842 Support 'let' option for multiple CRUD commands #164

Merged
merged 1 commit into from Apr 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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