Skip to content

Commit 493114f

Browse files
committed
DOCS-286 Redirect Indexing Commands Page
1 parent 1947bfe commit 493114f

File tree

2 files changed

+58
-52
lines changed

2 files changed

+58
-52
lines changed

source/administration/indexes.txt

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ resulting index.
6565
only creates an index if an index of the same specification does
6666
not already exist.
6767

68+
Special Creation Options
69+
~~~~~~~~~~~~~~~~~~~~~~~~
70+
71+
.. note::
72+
73+
TTL collections use a special ``expire`` index option. See
74+
:doc:`/tutorial/expire-data` for more information.
75+
76+
.. TODO: insert link here to the geospatial index documents when
77+
they're published.
78+
6879
Sparse Indexes
6980
``````````````
7081

@@ -135,6 +146,46 @@ You can also enforce a unique constraint on :ref:`compound indexes
135146
These indexes enforce uniqueness for the *combination* of index keys
136147
and *not* for either key individually.
137148

149+
Background
150+
``````````
151+
152+
To create an index in the background you can specify :ref:`background
153+
construction <index-creation-background>`. Consider the following
154+
prototype invocation of :method:`db.collection.ensureIndex()`:
155+
156+
.. code-block:: javascript
157+
158+
db.collection.ensureIndex( { a: 1 }, { background: true } )
159+
160+
Consider the section on :ref:`background index construction
161+
<index-creation-background>` for more information about these indexes
162+
and their implications.
163+
164+
Drop Duplicates
165+
```````````````
166+
167+
To force the creation of a :ref:`unique index <index-type-unique>`
168+
index on a collection with duplicate values in the field you are
169+
indexing you can use the ``dropDups`` option. This will force MongoDB
170+
to create a *unique* index by deleting documents with duplicate values
171+
when building the index. Consider the following prototype invocation
172+
of :method:`db.collection.ensureIndex()`:
173+
174+
.. code-block:: javascript
175+
176+
db.collection.ensureIndex( { a: 1 }, { dropDups: true } )
177+
178+
See the full documentation of :ref:`duplicate dropping
179+
<index-creation-duplicate-dropping>` for more information.
180+
181+
.. warning::
182+
183+
Specifying ``{ dropDups: true }`` may delete data from your
184+
database. Use with extreme caution.
185+
186+
Refer to the :method:`ensureIndex() <db.collection.ensureIndex()>`
187+
documentation for additional index creation options.
188+
138189
Removal
139190
~~~~~~~
140191

@@ -159,7 +210,7 @@ Where the value of ``nIndexesWas`` reflects the number of indexes
159210
for the :ref:`_id index <index-type-primary>` from a collection.
160211

161212
These shell helpers provide wrappers around the
162-
:dbcommand:`deleteIndexes` :term:`database command`. Your :doc:`client
213+
:dbcommand:`dropIndexes` :term:`database command`. Your :doc:`client
163214
library </applications/drivers>` may have a different or additional
164215
interface for these operations.
165216

@@ -203,54 +254,6 @@ may have a different or additional interface for this operation.
203254

204255
.. include:: /includes/note-build-indexes-on-replica-sets.rst
205256

206-
Special Creation Options
207-
~~~~~~~~~~~~~~~~~~~~~~~~
208-
209-
.. note::
210-
211-
TTL collections use a special ``expire`` index option. See
212-
:doc:`/tutorial/expire-data` for more information.
213-
214-
.. TODO: insert link here to the geospatial index documents when
215-
they're published.
216-
217-
Background
218-
``````````
219-
220-
To create an index in the background you can specify :ref:`background
221-
construction <index-creation-background>`. Consider the following
222-
prototype invocation of :method:`db.collection.ensureIndex()`:
223-
224-
.. code-block:: javascript
225-
226-
db.collection.ensureIndex( { a: 1 }, { background: true } )
227-
228-
Consider the section on :ref:`background index construction
229-
<index-creation-background>` for more information about these indexes
230-
and their implications.
231-
232-
Drop Duplicates
233-
```````````````
234-
235-
To force the creation of a :ref:`unique index <index-type-unique>`
236-
index on a collection with duplicate values in the field you are
237-
indexing you can use the ``dropDups`` option. This will force MongoDB
238-
to create a *unique* index by deleting documents with duplicate values
239-
when building the index. Consider the following prototype invocation
240-
of :method:`db.collection.ensureIndex()`:
241-
242-
.. code-block:: javascript
243-
244-
db.collection.ensureIndex( { a: 1 }, { dropDups: true } )
245-
246-
See the full documentation of :ref:`duplicate dropping
247-
<index-creation-duplicate-dropping>` for more information.
248-
249-
.. warning::
250-
251-
Specifying ``{ dropDups: true }`` may delete data from your
252-
database. Use with extreme caution.
253-
254257
.. _index-building-replica-sets:
255258

256259
Building Indexes on Replica Sets

source/reference/command/repairDatabase.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ repairDatabase
2121
there are no errors in the data storage.
2222

2323
As a side effect, the :dbcommand:`repairDatabase` command will
24-
compact the database, as the :dbcommand:`compact` command and
25-
reduce the total size of the data files on disk. Use the following
26-
syntax:
24+
compact the database, as the :dbcommand:`compact` command and reduce
25+
the total size of the data files on disk. The
26+
:dbcommand:`repairDatabase` command will also recreate all indexes
27+
in the database.
28+
29+
Use the following syntax:
2730

2831
.. code-block:: javascript
2932

0 commit comments

Comments
 (0)