Skip to content

Commit 5dfa6e4

Browse files
author
Dave
authored
DOCSP-19996 updates for update pt2 v5.1 (#109) (#111)
* DOCSP-19996-updates-for-update-pt2 * Add files
1 parent 8dbf0da commit 5dfa6e4

12 files changed

+20
-53
lines changed

source/core/query-optimization.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ To determine whether a query is a covered query, use the
205205
:method:`db.collection.explain()` or the :method:`~cursor.explain()`
206206
method and review the :ref:`results <explain-output-covered-queries>`.
207207

208-
.. include:: /includes/fact-explain-collection-method.rst
209-
210208
For more information see :ref:`indexes-measuring-use`.
211209

212210
.. toctree::

source/includes/fact-explain-collection-method.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
All |single-modification-operation-names| operations for a sharded
2-
collection that specify the |single-modification-operation-option| option must include the
3-
:term:`shard key` *or* the ``_id`` field in the query specification.
4-
|single-modification-operation-names| operations specifying |single-modification-operation-option|
5-
in a sharded collection which do not contain either the
6-
:term:`shard key` or the ``_id`` field return an error.
2+
collection that specify the |single-modification-operation-option|
3+
option must include the :term:`shard key` *or* the ``_id`` field in
4+
the query specification.
5+
6+
|single-modification-operation-names| operations specifying
7+
|single-modification-operation-option| in a sharded collection which do
8+
not contain either the :term:`shard key` or the ``_id`` field return an
9+
error.
10+

source/includes/table-transactions-operations.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
* - | :method:`db.collection.updateOne()`
8787
| :method:`db.collection.updateMany()`
8888
| :method:`db.collection.replaceOne()`
89-
| :method:`db.collection.update()`
9089
9190
- :dbcommand:`update`
9291

source/reference/glossary.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ Glossary
10201020

10211021
upsert
10221022
An option for update operations; e.g.
1023-
:method:`db.collection.update()`,
1023+
:method:`db.collection.updateOne()`,
10241024
:method:`db.collection.findAndModify()`. If set to true, the
10251025
update operation will either update the document(s) matched by
10261026
the specified query or if no documents match, insert a new

source/reference/limits.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Sharding Operational Restrictions
312312

313313
.. limit:: Single Document Modification Operations in Sharded Collections
314314

315-
.. |single-modification-operation-names| replace:: :method:`~db.collection.update()` and :method:`~db.collection.remove()`
315+
.. |single-modification-operation-names| replace:: :dbcommand:`update` and :method:`~db.collection.remove()`
316316
.. |single-modification-operation-option| replace:: ``justOne`` or ``multi: false``
317317

318318
.. include:: /includes/fact-single-modification-in-sharded-collections.rst

source/reference/method.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,6 @@ Collection
189189

190190
- Unhides an index from the query planner.
191191

192-
* - :method:`db.collection.update()`
193-
194-
- Modifies a document in a collection.
195-
196192
* - :method:`db.collection.updateOne()`
197193

198194
- Modifies a single document in a collection.

source/reference/method/db.collection.explain.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ specified :method:`~db.collection.find()` operation:
236236
~~~~~~~~~~~~~~~~~~~~~~~~~~
237237

238238
The following example runs :method:`db.collection.explain()` in
239-
``"allPlansExecution"`` verbosity mode. The
239+
``"allPlansExecution"`` verbosity mode.
240240
:method:`db.collection.explain()` returns the
241241
:data:`~explain.queryPlanner` and :data:`~explain.executionStats` for
242242
all considered plans for the specified
243-
:method:`~db.collection.update()` operation:
243+
:method:`~db.collection.findAndModify()` operation:
244244

245245
.. note::
246246

@@ -251,10 +251,11 @@ all considered plans for the specified
251251

252252
.. code-block:: javascript
253253

254-
db.products.explain("allPlansExecution").update(
255-
{ quantity: { $lt: 1000}, category: "apparel" },
256-
{ $set: { reorder: true } }
257-
)
254+
db.products.explain( "allPlansExecution" ).findAndModify( {
255+
query: { name: "Tom", state: "active", rating: { $gt: 10 } },
256+
sort: { rating: 1 },
257+
update: { $inc: { score: 1 } }
258+
} )
258259

259260
.. _explain-find-modifiers:
260261

source/reference/method/js-collection.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,6 @@ Collection Methods
186186

187187
- Unhides an index from the query planner.
188188

189-
* - :method:`db.collection.update()`
190-
191-
- Modifies a document in a collection.
192-
193189
* - :method:`db.collection.updateOne()`
194190

195191
- Modifies a single document in a collection.

source/reference/read-concern.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ of a multi-document transaction:
430430
-
431431

432432
* - | :dbcommand:`update`
433-
| :method:`db.collection.update()`
434433
| :method:`db.collection.updateMany()`
435434
| :method:`db.collection.updateOne()`
436435
| :method:`db.collection.replaceOne()`

source/reference/update-methods.txt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,16 @@ collection:
1111
:widths: 35 65
1212

1313
* - :method:`db.collection.updateOne()`
14-
1514
- Updates at most a single document that match a specified filter
1615
even though multiple documents may match the specified filter.
1716

18-
.. versionadded:: 3.2
19-
2017
* - :method:`db.collection.updateMany()`
21-
2218
- Update all documents that match a specified filter.
2319

24-
.. versionadded:: 3.2
25-
2620
* - :method:`db.collection.replaceOne()`
27-
2821
- Replaces at most a single document that match a specified filter
2922
even though multiple documents may match the specified filter.
3023

31-
.. versionadded:: 3.2
32-
33-
* - :method:`db.collection.update()`
34-
35-
- Either updates or replaces a single document that match a
36-
specified filter or updates all documents that match a specified
37-
filter.
38-
39-
By default, the :method:`db.collection.update()` method
40-
updates a **single** document. To update multiple documents, use
41-
the :ref:`multi <multi-parameter>` option.
42-
4324
.. _additional-updates:
4425

4526
Additional Methods
@@ -48,11 +29,8 @@ Additional Methods
4829
The following methods can also update documents from a collection:
4930

5031
- :method:`db.collection.findOneAndReplace()`.
51-
5232
- :method:`db.collection.findOneAndUpdate()`.
53-
5433
- :method:`db.collection.findAndModify()`.
55-
5634
- :method:`db.collection.bulkWrite()`.
5735

5836
See the individual reference pages for the methods for more information

source/tutorial/analyze-query-plan.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ Analyze Query Performance
2020
and the :method:`db.collection.explain("executionStats")
2121
<db.collection.explain()>` methods provide statistics about
2222
the performance of a query. These statistics can be useful in
23-
measuring if and how a query uses an index.
24-
25-
.. include:: /includes/fact-explain-collection-method.rst
23+
measuring if and how a query uses an index. See
24+
:method:`db.collection.explain()` for details.
2625

2726
- id: compass
2827
content: |

0 commit comments

Comments
 (0)