Skip to content

DOCS-2385: s/subdocument/embedded document/ #2160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/applications/design-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Some operational considerations include:
Avoid importing unmodified data
directly from a relational database. In general, you will want to "roll
up" certain data into richer documents that take advantage of MongoDB's
support for sub-documents and nested arrays.
support for embedded documents and nested arrays.

Case Sensitive Strings
~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion source/core/2dsphere.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The :ref:`geojson-multipoint`, :ref:`geojson-multilinestring`,
:ref:`geojson-geometrycollection` require ``2dsphere`` index version 2.

In order to index GeoJSON data, you must store the data in a location
field that you name. The location field contains a subdocument with a
field that you name. The location field contains an embedded document with a
``type`` field specifying the GeoJSON object type and a ``coordinates``
field specifying the object's coordinates. Always store coordinates in
``longitude, latitude`` order.
Expand Down
4 changes: 2 additions & 2 deletions source/core/data-model-design.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ in MongoDB must be smaller than the :limit:`maximum BSON document size

To interact with embedded documents, use :term:`dot notation` to "reach
into" embedded documents. See :ref:`query for data in arrays
<read-operations-arrays>` and :ref:`query data in sub-documents
<read-operations-subdocuments>` for more examples on accessing data in
<read-operations-arrays>` and :ref:`query data in embedded documents
<read-operations-embedded-documents>` for more examples on accessing data in
arrays and embedded documents.

.. _data-modeling-referencing:
Expand Down
2 changes: 1 addition & 1 deletion source/core/data-model-operations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ that provides atomic updates for a single document.

.. [#record-atomicity] Document-level atomic operations include all
operations within a single MongoDB document record: operations that
affect multiple sub-documents within that single record are still
affect multiple embedded documents within that single record are still
atomic.

Sharding
Expand Down
4 changes: 2 additions & 2 deletions source/core/data-modeling-introduction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ Embedded Data

Embedded documents capture relationships between data by storing
related data in a single document structure. MongoDB documents make it
possible to embed document structures as sub-documents in a field or
possible to embed document structures in a field or
array within a document. These *denormalized* data models allow
applications to retrieve and manipulate related data in a single
database operation.

.. include:: /images/data-model-denormalized.rst

See :ref:`data-modeling-embedding` for the strengths and weaknesses of
embedding sub-documents.
embedding documents.

.. end-primer-excerpt

Expand Down
2 changes: 1 addition & 1 deletion source/core/document.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Dot Notation

.. seealso::

- :ref:`read-operations-subdocuments` for dot notation examples
- :ref:`read-operations-embedded-documents` for dot notation examples
with embedded documents.

- :ref:`read-operations-arrays` for dot notation examples with
Expand Down
4 changes: 2 additions & 2 deletions source/core/geospatial-indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ the following:

db.places.createIndex( { "locs": "2d" } )

You may also model the location data as a field inside of a
sub-document. In this case, the document would contain a field
You may also model the location data as a field inside of an
embedded document. In this case, the document would contain a field
(e.g. ``addresses``) that holds an array of documents where each
document has a field (e.g. ``loc:``) that holds location
coordinates. For example:
Expand Down
2 changes: 1 addition & 1 deletion source/core/index-hashed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Hashed Index
.. versionadded:: 2.4

Hashed indexes maintain entries with hashes of the values of the
indexed field. The hashing function collapses sub-documents and
indexed field. The hashing function collapses embedded documents and
computes the hash for the entire value but does not support multi-key
(i.e. arrays) indexes.

Expand Down
6 changes: 3 additions & 3 deletions source/core/index-multikey.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ Hashed Indexes
``hashed`` indexes are not compatible with multi-key indexes.

To compute the hash for a ``hashed`` index, MongoDB collapses
sub-documents and computes the hash for the entire value. For fields
that hold arrays or sub-documents, you cannot use the index to support
queries that introspect the sub-document.
embedded documents and computes the hash for the entire value. For fields
that hold arrays or embedded documents, you cannot use the index to support
queries that introspect the embedded document.

Examples
--------
Expand Down
26 changes: 13 additions & 13 deletions source/core/index-single.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ Indexes on Embedded Fields

.. default-domain:: mongodb

You can create indexes on fields embedded in sub-documents, just as you
You can create indexes on fields within embedded documents, just as you
can index top-level fields in documents. Indexes on embedded fields
differ from :ref:`indexes on sub-documents <index-sub-documents>`,
differ from :ref:`indexes on embedded documents <index-embedded-documents>`,
which include the full content up to the maximum :limit:`index size
<Index Key>` of the sub-document in the index. Instead, indexes on
<Index Key>` of the embedded document in the index. Instead, indexes on
embedded fields allow you to use a "dot notation," to introspect into
sub-documents.
embedded documents.

Consider a collection named ``people`` that holds documents that resemble
the following example document:
Expand All @@ -117,16 +117,16 @@ following specification:

.. index:: index; subdocuments
.. _index-subdocuments:
.. _index-sub-documents:
.. _index-embedded-documents:
.. _index-subdocument:
.. _index-sub-document:
.. _index-embedded-document:

Indexes on Subdocuments
~~~~~~~~~~~~~~~~~~~~~~~~
Indexes on Embedded Dcuments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. default-domain:: mongodb

You can also create indexes on subdocuments.
You can also create indexes on embedded documents.

For example, the ``factories`` collection contains documents that
contain a ``metro`` field, such as:
Expand All @@ -142,7 +142,7 @@ contain a ``metro`` field, such as:
name: "Giant Factory"
}

The ``metro`` field is a subdocument, containing the embedded fields
The ``metro`` field is an embedded document, containing the embedded fields
``city`` and ``state``. The following command creates an index on the ``metro``
field as a whole:

Expand All @@ -157,13 +157,13 @@ The following query can use the index on the ``metro`` field:
db.factories.find( { metro: { city: "New York", state: "NY" } } )

This query returns the above document. When performing equality matches
on subdocuments, field order matters and the subdocuments must match
on embedded documents, field order matters and the embedded documents must match
exactly. For example, the following query does not match the above
document:

.. code-block:: javascript

db.factories.find( { metro: { state: "NY", city: "New York" } } )

See :ref:`query-subdocuments` for more information regarding querying
on subdocuments.
See :ref:`query-embedded-documents` for more information regarding querying
on embedded documents.
2 changes: 1 addition & 1 deletion source/core/index-types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Index Types

MongoDB provides a number of different index types. You can create
indexes on any field or embedded field within a document or
sub-document. You can create :doc:`single field indexes
embedded document. You can create :doc:`single field indexes
</core/index-single>` or :doc:`compound indexes
</core/index-compound>`. MongoDB also supports indexes of arrays,
called :ref:`multi-key indexes <index-type-multi-key>`, as well as
Expand Down
4 changes: 2 additions & 2 deletions source/core/query-optimization.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ An index **cannot** cover a query if:
a :ref:`multi-key index <index-type-multikey>` index and cannot
support a covered query.

- any of the returned indexed fields are fields in subdocuments.
- any of the returned indexed fields are fields in embedded documents.
[#index-embedded-document-fields]_ For example, consider a collection
``users`` with documents of the following form:

Expand Down Expand Up @@ -189,4 +189,4 @@ method and review the :ref:`results <explain-output-covered-queries>`.
For more information see :ref:`indexes-measuring-use`.

.. [#index-embedded-document-fields] To index fields
in subdocuments, use :term:`dot notation`.
in embedded documents, use :term:`dot notation`.
2 changes: 1 addition & 1 deletion source/faq/developers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ then you should maintain that model.
If, however, you can group these small documents by some logical
relationship *and* you frequently retrieve the documents by this
grouping, you might consider "rolling-up" the small documents into
larger documents that contain an array of subdocuments. Keep in mind
larger documents that contain an array of embedded documents. Keep in mind
that if you often only need to retrieve a subset of the documents
within the group, then "rolling-up" the documents may not provide
better performance.
Expand Down
4 changes: 2 additions & 2 deletions source/includes/apiargs-command-geoNear-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ description: |
If this is ``true``, the query
returns the location of the matching documents in the results. The
default is ``false``. This option is useful when a location field
contains multiple locations. To specify a field within a
subdocument, use :term:`dot notation`.
contains multiple locations. To specify a field within an
embedded document, use :term:`dot notation`.
interface: command
name: includeLocs
operation: geoNear
Expand Down
6 changes: 3 additions & 3 deletions source/includes/apiargs-pipeline-geoNear-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source:
arg_name: field
description: |
The output field that contains the
calculated distance. To specify a field within a subdocument,
calculated distance. To specify a field within an embedded document,
use :term:`dot notation`.
interface: pipeline
name: distanceField
Expand Down Expand Up @@ -70,8 +70,8 @@ arg_name: field
description: |
This specifies the output field that identifies the location used to
calculate the distance. This option is useful when a location field
contains multiple locations. To specify a field within a
subdocument, use :term:`dot notation`.
contains multiple locations. To specify a field within an
embedded document, use :term:`dot notation`.
interface: pipeline
name: includeLocs
operation: geoNear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ from the query statement.

The :projection:`$elemMatch` projection operator takes an explicit condition
argument. This allows you to project based on a condition not in the query, or
if you need to project based on multiple fields in the array's subdocuments.
if you need to project based on multiple fields in the array's embedded documents.
See :ref:`array-field-limitation` for an example.
6 changes: 3 additions & 3 deletions source/meta/style-guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Jargon and Common Terms
able to refer generically to instances (that may be either
:program:`mongod` or :program:`mongos`.)

* - sub-document
* - embedded document
- An embedded or nested document within a document or an array.
- embedded document, nested document
-
Expand Down Expand Up @@ -468,7 +468,7 @@ Data Structure Terms

- "value" refers to the contents of a "field".

- "sub-document" describes a nested document.
- "embedded document" describes a nested document.

Other Terms
~~~~~~~~~~~
Expand All @@ -485,5 +485,5 @@ Notes on Specific Features
- Geo-Location

#. While MongoDB *is capable* of storing coordinates in
sub-documents, in practice, users should only store coordinates
embedded documents, in practice, users should only store coordinates
in arrays. (See: `DOCS-41 <https://jira.mongodb.org/browse/DOCS-41>`_.)
4 changes: 2 additions & 2 deletions source/reference/command/connPoolStats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Output

.. data:: connPoolStats.hosts

The sub-documents of the :data:`~connPoolStats.hosts` :term:`document` report connections
The embedded documents of the :data:`~connPoolStats.hosts` :term:`document` report connections
between the :program:`mongos` or :program:`mongod` instance and each component
:program:`mongod` of the :term:`sharded cluster`.

Expand Down Expand Up @@ -136,7 +136,7 @@ Output
connection pools.

:program:`mongos` connect to :program:`mongod` instances using one
of three types of connections. The following sub-document reports
of three types of connections. The following embedded document reports
the total number of connections by type.

.. data:: connPoolStats.createdByType.master
Expand Down
4 changes: 2 additions & 2 deletions source/reference/command/distinct.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Definition
Finds the distinct values for a specified field across a single
collection. :dbcommand:`distinct` returns a document that contains
an array of the distinct values. The return document also contains
a subdocument with query statistics and the query plan.
an embedded document with query statistics and the query plan.

When possible, the :dbcommand:`distinct` command uses an index to
find documents and return values.
Expand All @@ -38,7 +38,7 @@ documents in the ``orders`` collection:
db.runCommand ( { distinct: "orders", key: "ord_dt" } )

Return an array of the distinct values of the field ``sku`` in the
subdocument ``item`` from all documents in the ``orders`` collection:
embedded document ``item`` from all documents in the ``orders`` collection:

.. code-block:: javascript

Expand Down
10 changes: 5 additions & 5 deletions source/reference/command/hostInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ hostInfo

.. data:: hostInfo.system

A sub-document about the underlying environment of the system
running the :program:`mongod` or :program:`mongos`
An embedded document providing information about the underlying
environment of the system running the :program:`mongod` or :program:`mongos`

.. data:: hostInfo.system.currentTime

Expand Down Expand Up @@ -102,7 +102,7 @@ hostInfo

.. data:: hostInfo.os

A sub-document that contains information about the operating
An embedded document that contains information about the operating
system running the :program:`mongod` and :program:`mongos`.

.. data:: hostInfo.os.type
Expand All @@ -122,9 +122,9 @@ hostInfo

.. data:: hostInfo.extra

A sub-document with extra information about the operating system
An embedded document with extra information about the operating system
and the underlying hardware. The content of the
:data:`~hostInfo.extra` sub-document depends on the operating
:data:`~hostInfo.extra` embedded document depends on the operating
system.

.. data:: hostInfo.extra.versionString
Expand Down
Loading