Skip to content

Commit 6a0497c

Browse files
(DOCSP-36307) Backport to 6.0 (#6283)
1 parent 4173b82 commit 6a0497c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

source/core/index-single.txt

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ Create an Index on Embedded Document
111111

112112
You can also create indexes on embedded document as a whole.
113113

114+
.. include:: /includes/indexes/embedded-object-need-entire-doc.rst
115+
114116
Consider a collection named ``schools`` that holds documents that
115117
resemble the following sample document:
116118

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When you create an index on an embedded document, only queries that
2+
specify the entire embedded document use the index. Queries on a
3+
specific field within the document do not use the index.

source/indexes.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,15 @@ example, consider the following scenarios:
4949
* - A salesperson often needs to look up client information by
5050
location. Location is stored in an embedded object with fields
5151
like ``state``, ``city``, and ``zipcode``. You can create an
52-
index on the entire ``location`` object to improve performance
53-
for queries on any field in that object.
52+
index on the ``location`` object to improve performance for
53+
queries on that object.
5454

55-
- :ref:`Single Field Index <indexes-single-field>` on an object
55+
.. note::
56+
57+
.. include:: /includes/indexes/embedded-object-need-entire-doc.rst
58+
59+
- :ref:`Single Field Index <indexes-single-field>` on an embedded
60+
document
5661

5762
* - A grocery store manager often needs to look up inventory items by
5863
name and quantity to determine which items are low stock. You can

0 commit comments

Comments
 (0)