Skip to content

Commit 16e055c

Browse files
committed
Address AS feedback
1 parent 3667bbd commit 16e055c

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

source/indexes/single-field-index.txt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ single field within a collection's documents. They improve single field query an
2525
performance, and support :manual:`TTL Indexes </core/index-ttl>` that automatically remove
2626
documents from a collection after a certain amount of time or at a specific clock time.
2727

28+
When creating a single-field index, you must specify the following:
29+
30+
- The field on which to create the index
31+
- The sort order for the indexed values (ascending or descending)
32+
2833
.. note::
2934

3035
The ``_id_`` index is an example of a single-field index. This index is automatically
@@ -38,7 +43,7 @@ database from the :atlas:`Atlas sample datasets </sample-data>`. To learn how to
3843
free MongoDB Atlas cluster and load the sample datasets, see the
3944
:atlas:`Get Started with Atlas </getting-started>` guide.
4045

41-
The documents in this collection are modeled by the following {+language+} data class:
46+
The following {+language+} data class models the documents in this collection:
4247

4348
.. literalinclude:: /includes/indexes/indexes.kt
4449
:start-after: start-movie-class
@@ -74,4 +79,18 @@ The following is an example of a query that is covered by the index created in t
7479

7580
Movie(id=573a1398f29313caabceb515, title=Batman, ...)
7681

77-
To learn more, see :manual:`Single Field Indexes </core/index-single>` in the {+mdb-server+} manual.
82+
Additional Information
83+
----------------------
84+
85+
To learn more about single-field indexes, see :manual:`Single Field Indexes </core/index-single>`
86+
in the {+mdb-server+} manual.
87+
88+
API Documentation
89+
~~~~~~~~~~~~~~~~~
90+
91+
To learn more about any of the methods or types discussed in this
92+
guide, see the following API Documentation:
93+
94+
- `find() <{+api+}/mongodb-driver-kotlin-sync/com.mongodb.kotlin.client/-mongo-collection/find.html>`__
95+
- `filter() <{+api+}/mongodb-driver-kotlin-sync/com.mongodb.kotlin.client/-find-iterable/filter.html>`__
96+
- `sort() <{+api+}/mongodb-driver-kotlin-sync/com.mongodb.kotlin.client/-find-iterable/sort.html/>`__

source/work-with-indexes.txt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@ your application's queries and operations that return sorted results. Each
4141
index that you add consumes disk space and memory when active, so we recommend
4242
that you track index memory and disk usage for capacity planning. In addition,
4343
when a write operation updates an indexed field, MongoDB updates the related
44-
index.
44+
index, which can negatively impact performance for write operations.
4545

46-
Because MongoDB supports dynamic schemas, applications can query against fields
47-
whose names are not known in advance or are arbitrary. MongoDB 4.2 introduced
48-
:manual:`wildcard indexes </core/index-wildcard/>` to help support these
49-
queries. Wildcard indexes are not designed to replace workload-based index
50-
planning.
46+
You can use :manual:`wildcard indexes </core/index-wildcard/>` in your MongoDB application
47+
to query against fields whose names are not known in advance or are arbitrary. Wildcard
48+
indexes are not designed to replace workload-based index planning.
5149

5250
For more information about designing your data model and choosing indexes appropriate for your application, see the
5351
:manual:`Data Modeling and Indexes </core/data-model-operations/#indexes>` guide
@@ -64,7 +62,7 @@ free MongoDB Atlas cluster and load the sample datasets, see the
6462
Create an Index
6563
---------------
6664

67-
MongoDB supports several different index types to support querying your data.
65+
MongoDB supports several different index types to help query your data.
6866
The following pages describe the most common index types and provide sample
6967
code for creating each index type.
7068

@@ -79,7 +77,7 @@ Remove an Index
7977
You can remove any unused index except the default unique index on the
8078
``_id`` field.
8179

82-
The following sections show how to remove a single index or to remove all
80+
The following sections show how to remove a single index or how to remove all
8381
indexes in a collection.
8482

8583
Delete a Single Index
@@ -105,8 +103,7 @@ collection:
105103
Delete All Indexes
106104
~~~~~~~~~~~~~~~~~~
107105

108-
Starting with MongoDB 4.2, you can drop all indexes by calling the
109-
``dropIndexes()`` method on your collection:
106+
You can drop all indexes by calling the ``dropIndexes()`` method on your collection:
110107

111108
.. literalinclude:: /includes/indexes/indexes.kt
112109
:language: kotlin

0 commit comments

Comments
 (0)