@@ -1985,8 +1985,9 @@ def create_index(self, keys, session=None, **kwargs):
19851985
19861986 - `name`: custom name to use for this index - if none is
19871987 given, a name will be generated.
1988- - `unique`: if ``True`` creates a uniqueness constraint on the index.
1989- - `background`: if ``True`` this index should be created in the
1988+ - `unique`: if ``True``, creates a uniqueness constraint on the
1989+ index.
1990+ - `background`: if ``True``, this index should be created in the
19901991 background.
19911992 - `sparse`: if ``True``, omit from the index any documents that lack
19921993 the indexed field.
@@ -2002,13 +2003,15 @@ def create_index(self, keys, session=None, **kwargs):
20022003 this collection after <int> seconds. The indexed field must
20032004 be a UTC datetime or the data will not expire.
20042005 - `partialFilterExpression`: A document that specifies a filter for
2005- a partial index. Requires server version >=3.2.
2006+ a partial index. Requires MongoDB >=3.2.
20062007 - `collation` (optional): An instance of
2007- :class:`~pymongo.collation.Collation`. This option is only supported
2008- on MongoDB 3.4 and above.
2008+ :class:`~pymongo.collation.Collation`. Requires MongoDB >= 3.4.
20092009 - `wildcardProjection`: Allows users to include or exclude specific
2010- field paths from a `wildcard index`_ using the { "$**" : 1} key
2011- pattern. Requires server version >= 4.2.
2010+ field paths from a `wildcard index`_ using the {"$**" : 1} key
2011+ pattern. Requires MongoDB >= 4.2.
2012+ - `hidden`: if ``True``, this index will be hidden from the query
2013+ planner and will not be evaluated as part of query plan
2014+ selection. Requires MongoDB >= 4.4.
20122015
20132016 See the MongoDB documentation for a full list of supported options by
20142017 server version.
@@ -2030,18 +2033,20 @@ def create_index(self, keys, session=None, **kwargs):
20302033 options (see the above list) should be passed as keyword
20312034 arguments
20322035
2036+ .. versionchanged:: 3.11
2037+ Added the ``hidden`` option.
20332038 .. versionchanged:: 3.6
20342039 Added ``session`` parameter. Added support for passing maxTimeMS
20352040 in kwargs.
20362041 .. versionchanged:: 3.4
20372042 Apply this collection's write concern automatically to this operation
20382043 when connected to MongoDB >= 3.4. Support the `collation` option.
20392044 .. versionchanged:: 3.2
2040- Added partialFilterExpression to support partial indexes.
2045+ Added partialFilterExpression to support partial indexes.
20412046 .. versionchanged:: 3.0
2042- Renamed `key_or_list` to `keys`. Removed the `cache_for` option.
2043- :meth:`create_index` no longer caches index names. Removed support
2044- for the drop_dups and bucket_size aliases.
2047+ Renamed `key_or_list` to `keys`. Removed the `cache_for` option.
2048+ :meth:`create_index` no longer caches index names. Removed support
2049+ for the drop_dups and bucket_size aliases.
20452050
20462051 .. mongodoc:: indexes
20472052
0 commit comments