From 6041dd4f8dfb4f469a3c13ed01de2627354a164c Mon Sep 17 00:00:00 2001 From: Andrew Aldridge Date: Fri, 10 Apr 2015 10:45:23 -0400 Subject: [PATCH] DOCS-5167: Move 3.0 dot notation change example out of API reference Fix of 00860578 --- .../apiargs-method-db.collection.update-param.yaml | 2 ++ source/includes/fact-mongodb30-upsert-id-example.rst | 7 +++++++ source/includes/fact-mongodb30-upsert-id.rst | 10 ++-------- source/reference/method/db.collection.update.txt | 9 +++++++++ source/release-notes/3.0-compatibility.txt | 2 ++ 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 source/includes/fact-mongodb30-upsert-id-example.rst diff --git a/source/includes/apiargs-method-db.collection.update-param.yaml b/source/includes/apiargs-method-db.collection.update-param.yaml index f16ace4ded6..2d073f22214 100644 --- a/source/includes/apiargs-method-db.collection.update-param.yaml +++ b/source/includes/apiargs-method-db.collection.update-param.yaml @@ -8,6 +8,8 @@ description: | .. include:: /includes/fact-mongodb30-upsert-id.rst + For an example, see :ref:`mongodb30-upsert-id`. + interface: method name: query operation: db.collection.update diff --git a/source/includes/fact-mongodb30-upsert-id-example.rst b/source/includes/fact-mongodb30-upsert-id-example.rst new file mode 100644 index 00000000000..3507f8c6ceb --- /dev/null +++ b/source/includes/fact-mongodb30-upsert-id-example.rst @@ -0,0 +1,7 @@ +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/includes/fact-mongodb30-upsert-id.rst b/source/includes/fact-mongodb30-upsert-id.rst index 490bf05e9b4..b8778127085 100644 --- a/source/includes/fact-mongodb30-upsert-id.rst +++ b/source/includes/fact-mongodb30-upsert-id.rst @@ -1,9 +1,3 @@ When you execute an :method:`~db.collection.update()` with the ``upsert`` -option, you can no longer use :ref:`document-dot-notation` to select only 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 } ) +option, you can not use :ref:`dot notation ` to select only +part of the ``_id`` field. diff --git a/source/reference/method/db.collection.update.txt b/source/reference/method/db.collection.update.txt index cefd6fe29ef..68cb44c93e3 100644 --- a/source/reference/method/db.collection.update.txt +++ b/source/reference/method/db.collection.update.txt @@ -211,6 +211,15 @@ Sharded Collections .. _update-method-examples: +.. _mongodb30-upsert-id: + +Upsert with Query on ``_id`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/fact-mongodb30-upsert-id.rst + +.. include:: /includes/fact-mongodb30-upsert-id-example.rst + Examples -------- diff --git a/source/release-notes/3.0-compatibility.txt b/source/release-notes/3.0-compatibility.txt index caa16ff1c5f..a00c1e1cc69 100644 --- a/source/release-notes/3.0-compatibility.txt +++ b/source/release-notes/3.0-compatibility.txt @@ -458,6 +458,8 @@ General Compatibility Changes .. include:: /includes/fact-mongodb30-upsert-id.rst +.. include:: /includes/fact-mongodb30-upsert-id-example.rst + Deprecate Access to ``system.indexes`` and ``system.namespaces`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~