Skip to content

Commit 559f6da

Browse files
(DOCSP-10774): Updating out of date instructions for Compass indexes
1 parent 861d263 commit 559f6da

File tree

3 files changed

+112
-58
lines changed

3 files changed

+112
-58
lines changed

source/includes/driver-examples/driver-example-indexes-1.rst

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -32,62 +32,9 @@
3232
the collection must contain documents.
3333

3434
To create an index in
35-
:ref:`MongoDB Compass <compass-index>`, complete the following
36-
steps:
35+
:ref:`MongoDB Compass <compass-index>`:
3736

38-
1. Navigate to the collection for which you wish to create
39-
the index:
40-
41-
a. In the left-hand MongoDB Compass navigation pane, click
42-
the database to which your target collection belongs.
43-
44-
b. From the database view, click the target collection name.
45-
46-
#. Click the :guilabel:`Indexes` tab:
47-
48-
.. figure:: /images/compass-index-tab.png
49-
:alt: Compass index tab
50-
51-
.. raw:: html
52-
53-
<br>
54-
55-
#. Click the :guilabel:`Create Index` button:
56-
57-
.. figure:: /images/compass-create-index-button.png
58-
:alt: Compass index button
59-
60-
.. raw:: html
61-
62-
<br>
63-
64-
The following dialog appears:
65-
66-
.. figure:: /images/compass-index-dialog.png
67-
:scale: 60 %
68-
:alt: Compass index dialog
69-
70-
#. (Optional) Enter the index name.
71-
72-
Leaving this field blank causes |compass| to create a
73-
default name for the index.
74-
75-
#. Add fields to the index.
76-
77-
Use the :guilabel:`Configure the index definition` section
78-
of the dialog to define the fields for your index and
79-
their respective types. To create an index on multiple
80-
fields, click :guilabel:`Add another field`.
81-
82-
#. (Optional) Specify the index options.
83-
84-
The following index options can be specified:
85-
86-
- Create a :ref:`unique index <unique-index>`
87-
- Create :ref:`TTL <ttl-index>`
88-
- Partial :ref:`filter expression <partial-index>`
89-
90-
#. Click :guilabel:`Create` to create the index.
37+
.. include:: /includes/steps/create-index-compass.rst
9138

9239
- id: python
9340
content: |

source/includes/driver-examples/driver-example-indexes-2.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
- id: compass
99
content: |
1010

11-
.. important::
12-
13-
|compass| does not support collation for indexes.
11+
.. note::
1412

1513
The following examples illustrate indexes and collation in
1614
the :doc:`Mongo Shell </mongo/>`.
1715

16+
Refer to the
17+
:hardlink:`MongoDB Compass Documentation
18+
</compass/current/indexes/>` for instructions on using
19+
custom collation with indexes in Compass.
20+
21+
1822
- id: python
1923
content: |
2024
.. include:: /includes/fact-collation-driver.rst
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
title: Navigate to the collection for which you wish to create the index.
2+
level: 4
3+
ref: navigate-to-collection
4+
content: |
5+
6+
a. In the left-hand MongoDB Compass navigation pane, click the
7+
database that contains your desired collection.
8+
9+
#. From the database view, click the target collection name.
10+
---
11+
title: Click the :guilabel:`Create Index` button.
12+
level: 4
13+
ref: create-collection
14+
content: |
15+
From the :ref:`Indexes <collection-tab>` tab, click the
16+
:guilabel:`Create Index` button to bring up the
17+
:guilabel:`Create Index` dialog.
18+
---
19+
title: Optional. Enter the index name.
20+
level: 4
21+
ref: enter-index-name
22+
content: |
23+
In the dialog, enter the name of the index to create, or leave blank
24+
to have MongoDB create a default name for the index.
25+
---
26+
title: Add fields to index.
27+
level: 4
28+
ref: index-fields
29+
content: |
30+
To specify a key for the index, select the field and the index type.
31+
To index additional fields, click :guilabel:`Add Another Field`.
32+
---
33+
title: Optional. Specify the index options.
34+
level: 4
35+
ref: index-options
36+
content: |
37+
38+
Compass supports the following index options:
39+
40+
.. list-table::
41+
:header-rows: 1
42+
:widths: 40 60 20
43+
44+
* - Option
45+
- Description
46+
- More Information
47+
48+
* - Build index in the background
49+
50+
- If checked, ensure that the MongoDB deployment remains
51+
available during the index build operation.
52+
53+
- :manual:`Background Construction </core/index-creation/index.html#background-construction>`
54+
55+
* - Create unique index
56+
57+
- If checked, ensure that the indexed fields do not
58+
store duplicate values.
59+
60+
- :manual:`Unique Indexes </core/index-unique>`
61+
62+
* - Create :abbr:`TTL (Time to Live)`
63+
64+
- If checked, automatically delete documents after a
65+
specified number of seconds since the indexed field value.
66+
67+
- :manual:`TTL Indexes </core/index-ttl>`
68+
69+
* - Partial filter expression
70+
71+
- If checked, only index documents which match the specified
72+
filter expression.
73+
74+
.. example::
75+
76+
The following partial filter expression only indexes
77+
documents where the ``timezone`` field exists:
78+
79+
.. code-block:: js
80+
81+
{ "timezone": { "$exists": true } }
82+
83+
- :manual:`Partial Indexes </core/index-partial/>`
84+
85+
* - Use custom collation
86+
87+
- If checked, create a custom collation for the index
88+
using the options provided in Compass.
89+
90+
- :manual:`Collation Document </reference/collation/#collation-document>`
91+
92+
* - Wildcard projection (*New in MongoDB 4.2*)
93+
94+
- If checked, support unknown or arbitrary fields
95+
which match the specified projection in the index.
96+
97+
- :manual-next:`Wildcard Indexes </core/index-wildcard/>`
98+
---
99+
title: Click :guilabel:`Create` to create the index.
100+
level: 4
101+
ref: create-index-button
102+
content: ""
103+
...

0 commit comments

Comments
 (0)