11title : Click the :guilabel:`Create Index` button.
22level : 4
33ref : create-collection
4+ stepnum : 1
45content : |
5- From the :ref:`Indexes <collection-tab>` tab, click the
6- :guilabel:`Create Index` button to bring up the
6+ From the :ref:`Indexes <collection-tab>` tab, click
7+ :guilabel:`Create Index` to open the
78 :guilabel:`Create Index` dialog.
89 ---
910title : Optional. Enter the index name.
1011level : 4
1112ref : enter-index-name
13+ stepnum : 2
1214content : |
1315 In the dialog, enter the name of the index to create, or leave blank
1416 to have MongoDB create a default name for the index.
1517 ---
1618title : Add fields to index.
1719level : 4
1820ref : index-fields
21+ stepnum : 3
1922content : |
20- To specify a key for the index, select the field and the index type.
21- To index additional fields, click :guilabel:`Add Another Field`.
23+
24+ a. Specify an index key.
25+
26+ - To specify an existing document field as an index key, select
27+ the field from the dropdown list.
28+
29+ - To specify a field which does not exist in any document as an
30+ index key, enter the field name in the input box.
31+
32+ - To create a :manual:`compound index </core/index-compound/>`,
33+ click :guilabel:`Add Another Field`.
34+
35+ b. Use the dropdown to the right of each field name to specify the
36+ index type (``ascending``, ``descending``, or
37+ :manual:`2dsphere </core/2dsphere/>`).
38+
39+ .. seealso::
40+
41+ To learn how to specify a wildcard index, see
42+ :ref:`compass-wildcard-index`.
43+
2244 ---
2345title : Optional. Specify the index options.
2446level : 4
2547ref : index-options
48+ stepnum : 4
2649content : |
2750
2851 |compass-short| supports the following index options:
@@ -37,29 +60,28 @@ content: |
3760
3861 * - Build index in the background
3962
40- - If checked, ensure that the MongoDB deployment remains
41- available during the index build operation.
63+ - Ensure that the MongoDB deployment remains available during
64+ the index build operation.
4265
4366 - :manual:`Background Construction </core/index-creation/index.html#background-construction>`
4467
4568 * - Create unique index
4669
47- - If checked, ensure that the indexed fields do not
48- store duplicate values.
70+ - Ensure that the indexed fields do not store duplicate values.
4971
5072 - :manual:`Unique Indexes </core/index-unique>`
5173
52- * - Create :abbr:`TTL (Time to Live)`
74+ * - Create a :abbr:`TTL (Time to Live)` index
5375
54- - If checked, automatically delete documents after a
55- specified number of seconds since the indexed field value.
76+ - Delete documents automatically after a specified number of
77+ seconds since the indexed field value.
5678
5779 - :manual:`TTL Indexes </core/index-ttl>`
5880
5981 * - Partial filter expression
6082
61- - If checked, only index documents which match the specified
62- filter expression.
83+ - Index only the documents which match the specified filter
84+ expression.
6385
6486 .. example::
6587
@@ -74,20 +96,38 @@ content: |
7496
7597 * - Use custom collation
7698
77- - If checked, create a custom collation for the index
78- using the options provided in |compass-short|.
99+ - Create a custom collation for the index using the options
100+ provided in |compass-short|.
79101
80102 - :manual:`Collation Document </reference/collation/#collation-document>`
81103
82104 * - Wildcard projection (*New in MongoDB 4.2*)
83105
84- - If checked, support unknown or arbitrary fields
85- which match the specified projection in the index.
106+ - Support unknown or arbitrary fields which match the specified
107+ projection in the index. To use a wildcard projection, set
108+ your index field name to ``$**``. This directs
109+ |compass-short| to use all fields in the document (excluding
110+ ``_id``).
111+
112+ .. example::
113+
114+ Consider the following wildcard projection document:
115+
116+ .. code-block:: javascript
117+
118+ {
119+ "product_attributes.elements" : 1,
120+ "product_attributes.resistance" : 1
121+ }
122+
123+ If your index field name is ``$**``, your index only
124+ includes the values of the fields in that projection.
86125
87- - :manual-next:`Wildcard Indexes </core/index -wildcard/> `
126+ - :ref:`compass -wildcard-index `
88127 ---
89- title : Click :guilabel:`Create` to create the index .
128+ title : Click :guilabel:`Create Index` .
90129level : 4
91130ref : create-index-button
131+ stepnum : 5
92132content : " "
93133...
0 commit comments