Skip to content
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
11 changes: 8 additions & 3 deletions source/includes/apiargs-method-db.collection.update-param.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
arg_name: param
description: |
The selection criteria for the update. Use the same :ref:`query
selectors <query-selectors>` as used in the :method:`find()
<db.collection.find()>` method.
The selection criteria for the update. The same :ref:`query
selectors <query-selectors>` as in the :method:`find()
<db.collection.find()>` method are available.

.. versionchanged:: 3.0

.. include:: /includes/fact-mongodb30-upsert-id.rst

interface: method
name: query
operation: db.collection.update
Expand Down
9 changes: 9 additions & 0 deletions source/includes/fact-mongodb30-upsert-id.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
When you execute an :method:`~db.collection.update()` with the ``upsert``
option, you can no longer use :ref:`document-dot-notation` to only select on
part of the ``_id`` field. For example, the following will raise an error:

.. code-block:: javascript

db.collection.update( { "_id.authorID": 1 },
{ "name": "Robert Frost" },
{ upsert: true } )
5 changes: 5 additions & 0 deletions source/release-notes/3.0-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ The minimum 3.0-compatible driver versions are:
General Compatibility Changes
-----------------------------

``upsert:true`` with a Dotted ``_id`` Query
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: /includes/fact-mongodb30-upsert-id.rst

Deprecate Access to ``system.indexes`` and ``system.namespaces``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion source/tutorial/modify-documents.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The replacement document can have different fields from the original
document. In the replacement document, you can omit the ``_id`` field
since the ``_id`` field is immutable. If you do include the ``_id``
field, it must be the same value as the existing value.

.. include:: /includes/steps/getting-started-update-replace.rst

``upsert`` Option
Expand Down