Skip to content

Commit 0086057

Browse files
i80andMichael Paik
authored andcommitted
DOCS-4884: Mention MongoDB 3.0 upsert changes
1 parent 43d70c6 commit 0086057

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

source/includes/apiargs-method-db.collection.update-param.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
arg_name: param
22
description: |
3-
The selection criteria for the update. Use the same :ref:`query
4-
selectors <query-selectors>` as used in the :method:`find()
5-
<db.collection.find()>` method.
3+
The selection criteria for the update. The same :ref:`query
4+
selectors <query-selectors>` as in the :method:`find()
5+
<db.collection.find()>` method are available.
6+
7+
.. versionchanged:: 3.0
8+
9+
.. include:: /includes/fact-mongodb30-upsert-id.rst
10+
611
interface: method
712
name: query
813
operation: db.collection.update
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
When you execute an :method:`~db.collection.update()` with the ``upsert``
2+
option, you can no longer use :ref:`document-dot-notation` to only select on
3+
part of the ``_id`` field. For example, the following will raise an error:
4+
5+
.. code-block:: javascript
6+
7+
db.collection.update( { "_id.authorID": 1 },
8+
{ "name": "Robert Frost" },
9+
{ upsert: true } )

source/release-notes/3.0-compatibility.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,11 @@ The minimum 3.0-compatible driver versions are:
475475
General Compatibility Changes
476476
-----------------------------
477477

478+
``upsert:true`` with a Dotted ``_id`` Query
479+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
480+
481+
.. include:: /includes/fact-mongodb30-upsert-id.rst
482+
478483
Deprecate Access to ``system.indexes`` and ``system.namespaces``
479484
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
480485

source/tutorial/modify-documents.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The replacement document can have different fields from the original
4444
document. In the replacement document, you can omit the ``_id`` field
4545
since the ``_id`` field is immutable. If you do include the ``_id``
4646
field, it must be the same value as the existing value.
47-
47+
4848
.. include:: /includes/steps/getting-started-update-replace.rst
4949

5050
``upsert`` Option

0 commit comments

Comments
 (0)