Skip to content

Commit 3667bbd

Browse files
committed
Fixes
1 parent a7c96fc commit 3667bbd

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

source/includes/indexes/indexes.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ fun main() {
3434
collection.dropIndex("_title_")
3535
// end-remove-index
3636

37+
// start-remove-all-indexes
38+
collection.dropIndexes()
39+
// end-remove-all-indexes
40+
3741
// start-index-single
3842
collection.createIndex(Indexes.ascending(Movie::title.name))
3943
// end-index-single

source/indexes.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ The following example creates an ascending index on the specified field:
6464
:copyable:
6565
:dedent:
6666

67-
.. TODO: To learn more about single field indexes, see the
68-
.. :ref:`kotlin-sync-single-field-index` guide.
67+
To learn more about single field indexes, see the :ref:`kotlin-sync-single-field-index` guide.
6968

7069
Compound Index
7170
--------------

source/indexes/single-field-index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The following example creates an index in ascending order on the ``title`` field
5656
:end-before: end-index-single
5757
:language: kotlin
5858
:copyable:
59+
:dedent:
5960

6061
The following is an example of a query that is covered by the index created in the preceding code example:
6162

source/work-with-indexes.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Overview
2525
--------
2626

2727
In this guide, you can learn how to use **indexes** with the {+driver-short+}.
28-
Indexes can improve the efficiency of queries and add additional functionality
29-
to querying and storing documents.
28+
Indexes can improve the efficiency of queries and add functionality to querying and
29+
storing documents.
3030

3131
Without indexes, MongoDB must scan every document in a collection to find the
3232
documents that match each query. These collection scans are slow and can negatively affect
@@ -94,6 +94,7 @@ collection:
9494
:language: kotlin
9595
:start-after: start-remove-index
9696
:end-before: end-remove-index
97+
:dedent:
9798

9899
.. note::
99100

@@ -107,9 +108,11 @@ Delete All Indexes
107108
Starting with MongoDB 4.2, you can drop all indexes by calling the
108109
``dropIndexes()`` method on your collection:
109110

110-
.. code-block:: kotlin
111-
112-
collection.dropIndexes()
111+
.. literalinclude:: /includes/indexes/indexes.kt
112+
:language: kotlin
113+
:start-after: start-remove-all-indexes
114+
:end-before: end-remove-all-indexes
115+
:dedent:
113116

114117
API Documentation
115118
~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)