PYTHON-3700 Clean up docs for create_index/drop_indexes (#1201)

This commit is contained in:
Shane Harvey 2023-05-02 13:45:55 -07:00 committed by GitHub
parent eb137fdf5c
commit 14e8b011c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -2030,11 +2030,11 @@ class Collection(common.BaseObject, Generic[_DocumentType]):
pairs specifying the index to create
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`.
arguments
- `comment` (optional): A user-provided comment to attach to this
command.
- `**kwargs` (optional): any additional index creation
options (see the above list) should be passed as keyword
arguments.
.. versionchanged:: 4.4
Allow passing a list containing (key, direction) pairs
@ -2082,14 +2082,11 @@ class Collection(common.BaseObject, Generic[_DocumentType]):
:Parameters:
- `session` (optional): a
:class:`~pymongo.client_session.ClientSession`.
arguments
- `comment` (optional): A user-provided comment to attach to this
command.
- `**kwargs` (optional): optional arguments to the createIndexes
command (like maxTimeMS) can be passed as keyword arguments.
.. note:: The :attr:`~pymongo.collection.Collection.write_concern` of
this collection is automatically applied to this operation.
@ -2100,7 +2097,6 @@ class Collection(common.BaseObject, Generic[_DocumentType]):
.. versionchanged:: 3.4
Apply this collection's write concern automatically to this operation
when connected to MongoDB >= 3.4.
"""
if comment is not None:
kwargs["comment"] = comment

View File

@ -480,10 +480,10 @@ class IndexModel(object):
:Parameters:
- `keys`: a single key or a list containing (key, direction) pairs
or keys specifying the index to create
or keys specifying the index to create.
- `**kwargs` (optional): any additional index creation
options (see the above list) should be passed as keyword
arguments
arguments.
.. versionchanged:: 3.11
Added the ``hidden`` option.