Skip to content

Commit b63e2a4

Browse files
Merge remote-tracking branch 'upstream/master' into v6.0
2 parents 65f74bc + 85597db commit b63e2a4

File tree

13 files changed

+260
-54
lines changed

13 files changed

+260
-54
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ examples:
151151
curl -SfL https://raw.githubusercontent.com/mongodb/mongo-ruby-driver/master/spec/integration/versioned_api_examples_spec.rb -o ${DRIVERS_PATH}/versioned_api_examples_spec.rb
152152

153153
# rust
154-
curl -SfL https://raw.githubusercontent.com/mongodb/mongo-rust-driver/master/src/test/documentation_examples/mod.rs -o ${DRIVERS_PATH}/mod.rs
154+
curl -SfL https://raw.githubusercontent.com/mongodb/mongo-rust-driver/main/src/test/documentation_examples/mod.rs -o ${DRIVERS_PATH}/mod.rs
155155

156156
# scala
157157
curl -SfL https://raw.githubusercontent.com/mongodb/mongo-scala-driver/master/driver/src/it/scala/org/mongodb/scala/DocumentationExampleSpec.scala -o ${DRIVERS_PATH}/DocumentationExampleSpec.scala

source/applications/indexes.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,24 @@ index, and in addition, MongoDB can use an :doc:`intersection
3737

3838
The following documents introduce indexing strategies:
3939

40-
:doc:`/tutorial/create-indexes-to-support-queries`
40+
:ref:`Use the ESR (Equality, Sort, Range) Rule <esr-indexing-rule>`
41+
The ESR (Equality, Sort, Range) Rule is a guide to creating indexes
42+
that support your queries efficiently.
43+
44+
:ref:`create-indexes-to-support-queries`
4145
An index supports a query when the index contains all the fields
4246
scanned by the query. Creating indexes that support queries
4347
results in greatly increased query performance.
4448

45-
:doc:`/tutorial/sort-results-with-indexes`
49+
:ref:`sorting-with-indexes`
4650
To support efficient queries, use the strategies here when you
4751
specify the sequential order and sort order of index fields.
4852

49-
:doc:`/tutorial/ensure-indexes-fit-ram`
53+
:ref:`indexes-ensure-indexes-fit-ram`
5054
When your index fits in RAM, the system can avoid reading the
5155
index from disk and you get the fastest processing.
5256

53-
:doc:`/tutorial/create-queries-that-ensure-selectivity`
57+
:ref:`index-selectivity`
5458
Selectivity is the ability of a query to narrow results using the
5559
index. Selectivity allows MongoDB to use the index for a larger
5660
portion of the work associated with fulfilling the query.
@@ -60,6 +64,7 @@ The following documents introduce indexing strategies:
6064
:titlesonly:
6165
:hidden:
6266

67+
/tutorial/equality-sort-range-rule
6368
/tutorial/create-indexes-to-support-queries
6469
/tutorial/sort-results-with-indexes
6570
/tutorial/ensure-indexes-fit-ram

source/core/index-compound.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ operation that resembles the following prototype:
3939

4040
.. include:: /includes/fact-index-specification-field-value.rst
4141

42+
The order of the indexed fields has a strong impact on the
43+
effectiveness of a particular index for a given query. For most
44+
compound indexes, following the :ref:`ESR (Equality, Sort, Range) rule
45+
<esr-indexing-rule>` helps to create efficient indexes.
46+
4247
.. important::
4348

4449
Starting in MongoDB 4.4:

source/index.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ What is MongoDB?
1818
.. button:: Get started with MongoDB Atlas
1919
:uri: https://www.mongodb.com/cloud?tck=docs_server
2020

21-
.. include:: /includes/fact-mongodb-intro.rst
21+
.. include:: /includes/rapid-release-short.rst
2222

2323
.. image:: /images/hero.png
2424
:alt: Homepage hero image

source/indexes.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ index can support a sort operation. See
142142
:ref:`index-ascending-and-descending` for more information on the
143143
impact of index order on results in compound indexes.
144144

145-
See :doc:`/core/index-compound` and :ref:`sort-on-multiple-fields` for
146-
more information on compound indexes.
145+
See also:
146+
147+
- :ref:`index-type-compound`,
148+
- :ref:`sort-on-multiple-fields`, and
149+
- :ref:`esr-indexing-rule`
147150

148151
Multikey Index
149152
~~~~~~~~~~~~~~
@@ -284,13 +287,6 @@ Indexes and Collation
284287

285288
.. include:: /includes/extracts/collation-versionadded.rst
286289

287-
----------
288-
289-
|arrow| Use the **Select your language** drop-down menu in the
290-
upper-right to set the language of the examples on this page.
291-
292-
----------
293-
294290
.. include:: /includes/driver-examples/driver-example-indexes-2.rst
295291

296292
.. include:: /includes/extracts/collation-index-use.rst

source/reference/database-references.txt

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,49 @@ Database References
1313
:class: singlecol
1414

1515
For many use cases in MongoDB, the denormalized data model where
16-
related data is stored within a single :term:`document <document>` will
17-
be optimal. However, in some cases, it makes sense to store related
16+
related data is stored within a single :term:`document <document>` is optimal.
17+
However, in some cases, it makes sense to store related
1818
information in separate documents, typically in different collections
1919
or databases.
2020

2121
.. important::
2222

23-
MongoDB 3.2 introduces :pipeline:`$lookup` pipeline stage to perform
23+
You can use the :pipeline:`$lookup` pipeline stage to perform
2424
a left outer join to an unsharded collection in the same database.
25-
For more information and examples, see :pipeline:`$lookup`.
2625

27-
Starting in MongoDB 3.4, you can also use :pipeline:`$graphLookup`
28-
pipeline stage to join an unsharded collection to perform recursive
29-
search. For more information and examples, see
30-
:pipeline:`$graphLookup`.
26+
You can also use the :pipeline:`$graphLookup` pipeline stage to join an
27+
unsharded collection to perform recursive search.
3128

3229
This page outlines alternative procedures that predate the
3330
:pipeline:`$lookup` and :pipeline:`$graphLookup` pipeline stages.
3431

35-
MongoDB applications use one of two methods for relating documents:
32+
MongoDB applications use one of two methods to relate documents:
3633

37-
- :ref:`Manual references <document-references>` where you save the
34+
- :ref:`Manual references <document-references>` save the
3835
``_id`` field of one document in another document as a reference.
39-
Then your application can run a second query to return the related
36+
Your application runs a second query to return the related
4037
data. These references are simple and sufficient for most use
4138
cases.
4239

4340
- :ref:`DBRefs <dbref-explanation>` are references from one document to another
4441
using the value of the first document's ``_id`` field, collection name,
45-
and, optionally, its database name. By including these names, DBRefs
46-
allow documents located in multiple collections to be more easily linked
47-
with documents from a single collection.
48-
49-
To resolve DBRefs, your application
50-
must perform additional queries to return the referenced
51-
documents. Many :driver:`Drivers </>` have helper
52-
methods that form the query for the DBRef automatically. The
53-
drivers [#official-driver]_ do not *automatically* resolve DBRefs
54-
into documents.
55-
56-
DBRefs provide a common format and type to represent relationships among
57-
documents. The DBRef format also provides common semantics for representing
58-
links between documents if your database must interact with
59-
multiple frameworks and tools.
42+
and, optionally, its database name, as well as any other fields. DBRefs allow
43+
you to more easily reference documents stored in multiple collections or
44+
databases.
45+
46+
To resolve DBRefs, your application must perform additional queries to return
47+
the referenced documents. Some :driver:`MongoDB drivers </>` provide helper
48+
methods to enable DBRefs to be resolved into documents, but it doesn't happen
49+
automatically.
50+
51+
DBRefs provide a common format and type to represent relationships among
52+
documents. The DBRef format also provides common semantics for representing
53+
links between documents if your database must interact with
54+
multiple frameworks and tools.
6055

6156
Unless you have a compelling reason to use DBRefs, use manual
6257
references instead.
6358

64-
.. [#official-driver] Some community supported drivers may have
65-
alternate behavior and may resolve a DBRef into a document
66-
automatically.
67-
6859
.. _document-references:
6960

7061
Manual References
@@ -73,7 +64,7 @@ Manual References
7364
Background
7465
~~~~~~~~~~
7566

76-
Using manual references is the practice of including one
67+
A manual reference is the practice of including one
7768
:term:`document's <document>` ``_id`` field in another document. The
7869
application can then issue a second query to resolve the referenced
7970
fields as needed.
@@ -129,7 +120,11 @@ Background
129120
DBRefs are a convention for representing a :term:`document`, rather
130121
than a specific reference type. They include the name of the
131122
collection, and in some cases the database name, in addition to the
132-
value from the ``_id`` field.
123+
value from the ``_id`` field.
124+
125+
Optionally, DBRefs can include any number of other fields. Extra field names
126+
must follow any :ref:`rules for field names <limit-restrictions-on-field-names>`
127+
imposed by the server version.
133128

134129
Format
135130
~~~~~~
@@ -153,8 +148,6 @@ DBRefs have the following fields:
153148
Contains the name of the database where the referenced document
154149
resides.
155150

156-
Only some drivers support ``$db`` references.
157-
158151
.. example::
159152

160153
DBRef documents resemble the following document:
@@ -174,13 +167,15 @@ DBRefs have the following fields:
174167
"creator" : {
175168
"$ref" : "creators",
176169
"$id" : ObjectId("5126bc054aed4daf9e2ab772"),
177-
"$db" : "users"
170+
"$db" : "users",
171+
"extraField" : "anything"
178172
}
179173
}
180174

181175
The DBRef in this example points to a document in the ``creators``
182176
collection of the ``users`` database that has
183-
``ObjectId("5126bc054aed4daf9e2ab772")`` in its ``_id`` field.
177+
``ObjectId("5126bc054aed4daf9e2ab772")`` in its ``_id`` field. It also contains
178+
an optional field.
184179

185180
.. note::
186181

source/reference/explain-results.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,14 +718,20 @@ representative. Your output may differ significantly.
718718
* - ``spilledBytesApprox``
719719
- The approximate number of in-memory bytes spilled to disk in
720720
the stage.
721+
722+
.. versionadded:: 5.3
721723
- ``GROUP``
722724

723725
* - ``spilledRecords``
724726
- The number of produced records spilled to disk in the stage.
727+
728+
.. versionadded:: 5.3
725729
- ``GROUP``
726730

727731
* - ``usedDisk``
728732
- Whether the stage wrote to disk.
733+
734+
.. versionadded:: 5.3
729735
- ``GROUP``
730736

731737
.. data:: explain.executionStats.allPlansExecution

source/reference/method/cursor.hint.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _cursor-hint:
2+
13
=============
24
cursor.hint()
35
=============

source/reference/operator/aggregation/geoNear.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,4 +527,3 @@ The aggregation returns the following:
527527
"calculated" : 5887.92792958097
528528
}
529529
}
530-

source/release-notes/5.0.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Patch Releases
1919

2020
.. _5.0.7-release-notes:
2121

22-
5.0.7 - Upcoming
23-
~~~~~~~~~~~~~~~~
22+
5.0.7 - April 11, 2022
23+
~~~~~~~~~~~~~~~~~~~~~~
2424

2525
Issues fixed:
2626

0 commit comments

Comments
 (0)