From 83fe7f7eefba10e2ad71fa68b25235d226860811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20G=C3=A9rard?= Date: Mon, 22 Oct 2018 21:54:46 +0200 Subject: [PATCH] Document the index option and the fact that additional options gets forwarded to pymongo's create_index method --- docs/guide/defining-documents.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/guide/defining-documents.rst b/docs/guide/defining-documents.rst index bf74ad8c..be8d9a15 100644 --- a/docs/guide/defining-documents.rst +++ b/docs/guide/defining-documents.rst @@ -492,7 +492,9 @@ the field name with a **#**:: ] } -If a dictionary is passed then the following options are available: +If a dictionary is passed then additional options become available. Valid options include, +but are not limited to: + :attr:`fields` (Default: None) The fields to index. Specified in the same format as described above. @@ -516,8 +518,12 @@ If a dictionary is passed then the following options are available: :attr:`name` (Optional) Allows you to specify a name for the index +:attr:`collation` (Optional) + Allows to create case insensitive indexes (MongoDB v3.4+ only) + .. note:: + Additional options are forwarded as **kwargs to pymongo's create_index method. Inheritance adds extra fields indices see: :ref:`document-inheritance`. Global index default options @@ -736,7 +742,7 @@ document.:: .. note:: From 0.8 onwards :attr:`allow_inheritance` defaults to False, meaning you must set it to True to use inheritance. - + Setting :attr:`allow_inheritance` to True should also be used in :class:`~mongoengine.EmbeddedDocument` class in case you need to subclass it