PYTHON-792 - Update create collection and index docs.
This commit is contained in:
parent
e9e764c4f3
commit
807c6797e1
@ -976,7 +976,7 @@ class Collection(common.BaseObject):
|
||||
>>> my_collection.create_index([("mike", pymongo.DESCENDING)],
|
||||
... background=True)
|
||||
|
||||
Valid options include:
|
||||
Valid options include, but are not limited to:
|
||||
|
||||
- `name`: custom name to use for this index - if none is
|
||||
given, a name will be generated
|
||||
@ -1000,6 +1000,9 @@ class Collection(common.BaseObject):
|
||||
values are dropped during index creation when creating a unique
|
||||
index
|
||||
|
||||
See the MongoDB documentation for a full list of supported options by
|
||||
server version.
|
||||
|
||||
.. warning:: `dropDups` / `drop_dups` is no longer supported by
|
||||
MongoDB starting with server version 2.7.5. The option is silently
|
||||
ignored by the server and unique index builds using the option will
|
||||
@ -1111,7 +1114,8 @@ class Collection(common.BaseObject):
|
||||
``None`` if the index is already cached.
|
||||
|
||||
All optional index creation parameters should be passed as
|
||||
keyword arguments to this method. Valid options include:
|
||||
keyword arguments to this method. Valid options include, but are not
|
||||
limited to:
|
||||
|
||||
- `name`: custom name to use for this index - if none is
|
||||
given, a name will be generated
|
||||
@ -1135,6 +1139,9 @@ class Collection(common.BaseObject):
|
||||
values are dropped during index creation when creating a unique
|
||||
index
|
||||
|
||||
See the MongoDB documentation for a full list of supported options by
|
||||
server version.
|
||||
|
||||
.. warning:: `dropDups` / `drop_dups` is no longer supported by
|
||||
MongoDB starting with server version 2.7.5. The option is silently
|
||||
ignored by the server and unique index builds using the option will
|
||||
|
||||
@ -208,8 +208,8 @@ class Database(common.BaseObject):
|
||||
creation. :class:`~pymongo.errors.CollectionInvalid` will be
|
||||
raised if the collection already exists.
|
||||
|
||||
Options should be passed as keyword arguments to this
|
||||
method. Any of the following options are valid:
|
||||
Options should be passed as keyword arguments to this method. Supported
|
||||
options vary with MongoDB release. Some examples include:
|
||||
|
||||
- "size": desired initial size for the collection (in
|
||||
bytes). For capped collections this size is the max
|
||||
@ -217,6 +217,9 @@ class Database(common.BaseObject):
|
||||
- "capped": if True, this is a capped collection
|
||||
- "max": maximum number of objects if capped (optional)
|
||||
|
||||
See the MongoDB documentation for a full list of supported options by
|
||||
server version.
|
||||
|
||||
:Parameters:
|
||||
- `name`: the name of the collection to create
|
||||
- `**kwargs` (optional): additional keyword arguments will
|
||||
|
||||
Loading…
Reference in New Issue
Block a user