Skip to content

Commit bc9b187

Browse files
committed
DOCS-4884: Mention MongoDB 3.0 upsert changes
1 parent 3e4bb2a commit bc9b187

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
When you execute an upsert, you can no longer use dot notation to only select
2+
on part of the ``_id`` field. For example, the following will raise an error:
3+
4+
.. code-block:: javascript
5+
6+
db.collection.update( { "_id.name": "Robert"},
7+
{ _id: { "name": "Robert Frost" } },
8+
{ 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+
Upserts and ``_id``
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)