diff --git a/source/includes/apiargs-method-db.collection.update-param.yaml b/source/includes/apiargs-method-db.collection.update-param.yaml index 8aa5c79566..f16ace4ded 100644 --- a/source/includes/apiargs-method-db.collection.update-param.yaml +++ b/source/includes/apiargs-method-db.collection.update-param.yaml @@ -1,8 +1,13 @@ arg_name: param description: | - The selection criteria for the update. Use the same :ref:`query - selectors ` as used in the :method:`find() - ` method. + The selection criteria for the update. The same :ref:`query + selectors ` as in the :method:`find() + ` method are available. + + .. versionchanged:: 3.0 + + .. include:: /includes/fact-mongodb30-upsert-id.rst + interface: method name: query operation: db.collection.update diff --git a/source/includes/fact-mongodb30-upsert-id.rst b/source/includes/fact-mongodb30-upsert-id.rst new file mode 100644 index 0000000000..fd67cda2ef --- /dev/null +++ b/source/includes/fact-mongodb30-upsert-id.rst @@ -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 } ) diff --git a/source/release-notes/3.0-compatibility.txt b/source/release-notes/3.0-compatibility.txt index b3ec6cfc95..79bf5b00fa 100644 --- a/source/release-notes/3.0-compatibility.txt +++ b/source/release-notes/3.0-compatibility.txt @@ -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`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/tutorial/modify-documents.txt b/source/tutorial/modify-documents.txt index 47875ca4e6..b8626da918 100644 --- a/source/tutorial/modify-documents.txt +++ b/source/tutorial/modify-documents.txt @@ -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