From ce291f2ec04ecc5c2015d36679cd02bd2ef30bcc Mon Sep 17 00:00:00 2001 From: jeff-allen-mongo <jeffrey.allen@10gen.com> Date: Mon, 20 Sep 2021 09:59:33 -0400 Subject: [PATCH] Revert "DOCS-14472 update operators act in lexicographic order" This reverts commit 9200afee266c9d79d0dc01747c10aa0ee1eb3702. --- ...ct-update-operator-lexicographic-order.rst | 3 --- source/reference/operator/update.txt | 24 ------------------- source/reference/operator/update/addToSet.txt | 2 -- source/reference/operator/update/bit.txt | 5 ---- .../reference/operator/update/currentDate.txt | 2 -- source/reference/operator/update/each.txt | 5 ---- source/reference/operator/update/inc.txt | 4 +--- source/reference/operator/update/max.txt | 2 -- source/reference/operator/update/min.txt | 4 +--- source/reference/operator/update/mul.txt | 2 -- source/reference/operator/update/pop.txt | 2 -- source/reference/operator/update/position.txt | 4 ---- .../operator/update/positional-all.txt | 2 -- .../operator/update/positional-filtered.txt | 2 -- .../reference/operator/update/positional.txt | 2 -- source/reference/operator/update/pull.txt | 2 -- source/reference/operator/update/pullAll.txt | 2 -- source/reference/operator/update/push.txt | 2 -- source/reference/operator/update/rename.txt | 2 -- source/reference/operator/update/set.txt | 4 ++-- .../reference/operator/update/setOnInsert.txt | 5 ---- source/reference/operator/update/slice.txt | 2 -- source/reference/operator/update/sort.txt | 2 -- source/reference/operator/update/unset.txt | 2 -- 24 files changed, 4 insertions(+), 84 deletions(-) delete mode 100644 source/includes/fact-update-operator-lexicographic-order.rst diff --git a/source/includes/fact-update-operator-lexicographic-order.rst b/source/includes/fact-update-operator-lexicographic-order.rst deleted file mode 100644 index 2be6554725d..00000000000 --- a/source/includes/fact-update-operator-lexicographic-order.rst +++ /dev/null @@ -1,3 +0,0 @@ -In MongoDB 4.4 and earlier, update operators process document fields -in lexicographic order. See :ref:`Update Operators Behavior -<update-operators-lexicographic-order>` for details. \ No newline at end of file diff --git a/source/reference/operator/update.txt b/source/reference/operator/update.txt index d3e82ab83ab..2f4cf5db53d 100644 --- a/source/reference/operator/update.txt +++ b/source/reference/operator/update.txt @@ -33,30 +33,6 @@ Specify the operator expression in a document of the form: Update Operators ---------------- -.. _update-operators-lexicographic-order: - -Behavior -~~~~~~~~ - -In MongoDB 4.4 and earlier, update operators process all document fields -in lexicographic order. - -In MongoDB 5.0 and later, update operators process document fields with -string-based names in lexicographic order. Fields with numeric names are -processed in numeric order. - -Consider this example :update:`$set` command: - -.. code-block:: javascript - - { $set: { "a.2": <new value>, "a.10": <new value>, } } - -In MongoDB 4.4, ``"a.10"`` is processed before ``"a.2"`` because ``10`` -comes before ``2`` in lexicographic order. - -In MongoDB 5.0, ``"a.2"`` is processed before ``"a.10"`` because ``2`` -comes before ``10`` in numeric order. - Fields ~~~~~~ diff --git a/source/reference/operator/update/addToSet.txt b/source/reference/operator/update/addToSet.txt index a8a4403662a..b18794c3529 100644 --- a/source/reference/operator/update/addToSet.txt +++ b/source/reference/operator/update/addToSet.txt @@ -30,8 +30,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - :update:`$addToSet` only ensures that there are no duplicate items *added* to the set and does not affect existing duplicate elements. :update:`$addToSet` does not guarantee a particular ordering of diff --git a/source/reference/operator/update/bit.txt b/source/reference/operator/update/bit.txt index 36bce5e36c1..1bf64ddb75c 100644 --- a/source/reference/operator/update/bit.txt +++ b/source/reference/operator/update/bit.txt @@ -37,11 +37,6 @@ Definition constructor to specify integers. See :ref:`shell-type-int` or :ref:`shell-type-long` for more information. -Behavior --------- - -.. include:: /includes/fact-update-operator-lexicographic-order.rst - Examples -------- diff --git a/source/reference/operator/update/currentDate.txt b/source/reference/operator/update/currentDate.txt index 26854cf532f..982347279cf 100644 --- a/source/reference/operator/update/currentDate.txt +++ b/source/reference/operator/update/currentDate.txt @@ -42,8 +42,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - If the field does not exist, :update:`$currentDate` adds the field to a document. diff --git a/source/reference/operator/update/each.txt b/source/reference/operator/update/each.txt index e309c2cc66a..f7e9c2a19dc 100644 --- a/source/reference/operator/update/each.txt +++ b/source/reference/operator/update/each.txt @@ -37,11 +37,6 @@ Definition other modifiers. For a list of modifiers available for :update:`$push`, see :ref:`push-modifiers`. -Behavior --------- - -.. include:: /includes/fact-update-operator-lexicographic-order.rst - Examples -------- diff --git a/source/reference/operator/update/inc.txt b/source/reference/operator/update/inc.txt index 746145ccc3d..5635250f66a 100644 --- a/source/reference/operator/update/inc.txt +++ b/source/reference/operator/update/inc.txt @@ -23,12 +23,10 @@ Definition { $inc: { <field1>: <amount1>, <field2>: <amount2>, ... } } .. include:: /includes/use-dot-notation.rst - + Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - The :update:`$inc` operator accepts positive and negative values. If the field does not exist, :update:`$inc` creates the field and sets diff --git a/source/reference/operator/update/max.txt b/source/reference/operator/update/max.txt index 81678b8dff7..8dfa2f157da 100644 --- a/source/reference/operator/update/max.txt +++ b/source/reference/operator/update/max.txt @@ -32,8 +32,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - If the field does not exists, the :update:`$max` operator sets the field to the specified value. diff --git a/source/reference/operator/update/min.txt b/source/reference/operator/update/min.txt index 6f8a2c5caf7..568634e0c78 100644 --- a/source/reference/operator/update/min.txt +++ b/source/reference/operator/update/min.txt @@ -30,9 +30,7 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - -If the field does not exist, the :update:`$min` operator sets the +If the field does not exists, the :update:`$min` operator sets the field to the specified value. For comparisons between values of different types, such as a number and diff --git a/source/reference/operator/update/mul.txt b/source/reference/operator/update/mul.txt index 17ec7c2d0ee..0a0d157fd32 100644 --- a/source/reference/operator/update/mul.txt +++ b/source/reference/operator/update/mul.txt @@ -29,8 +29,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - Missing Field ~~~~~~~~~~~~~ diff --git a/source/reference/operator/update/pop.txt b/source/reference/operator/update/pop.txt index 771da778690..44a8b3bfe33 100644 --- a/source/reference/operator/update/pop.txt +++ b/source/reference/operator/update/pop.txt @@ -31,8 +31,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - The :update:`$pop` operation fails if the ``<field>`` is not an array. If the :update:`$pop` operator removes the last item in the diff --git a/source/reference/operator/update/position.txt b/source/reference/operator/update/position.txt index db40fec956f..db80a79f32d 100644 --- a/source/reference/operator/update/position.txt +++ b/source/reference/operator/update/position.txt @@ -58,10 +58,6 @@ Definition greater than or equal to the length of the array, the :update:`$push` adds elements to the beginning of the array. -Behavior --------- - -.. include:: /includes/fact-update-operator-lexicographic-order.rst Examples -------- diff --git a/source/reference/operator/update/positional-all.txt b/source/reference/operator/update/positional-all.txt index 5b04f7679f2..74a54286673 100644 --- a/source/reference/operator/update/positional-all.txt +++ b/source/reference/operator/update/positional-all.txt @@ -43,8 +43,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - ``upsert`` ~~~~~~~~~~~ diff --git a/source/reference/operator/update/positional-filtered.txt b/source/reference/operator/update/positional-filtered.txt index 4a5e7fcb734..32f6e69681e 100644 --- a/source/reference/operator/update/positional-filtered.txt +++ b/source/reference/operator/update/positional-filtered.txt @@ -52,8 +52,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - ``upsert`` ~~~~~~~~~~~ diff --git a/source/reference/operator/update/positional.txt b/source/reference/operator/update/positional.txt index 5375b017bab..05cc017f582 100644 --- a/source/reference/operator/update/positional.txt +++ b/source/reference/operator/update/positional.txt @@ -59,8 +59,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - ``upsert`` ~~~~~~~~~~~ diff --git a/source/reference/operator/update/pull.txt b/source/reference/operator/update/pull.txt index 2d7ec56d94d..56ea92f57b1 100644 --- a/source/reference/operator/update/pull.txt +++ b/source/reference/operator/update/pull.txt @@ -26,8 +26,6 @@ $pull Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - If you specify a ``<condition>`` and the array elements are embedded documents, :update:`$pull` operator applies the ``<condition>`` as if each array element were a document in a collection. See diff --git a/source/reference/operator/update/pullAll.txt b/source/reference/operator/update/pullAll.txt index 41e10a52e49..79f0ba8d199 100644 --- a/source/reference/operator/update/pullAll.txt +++ b/source/reference/operator/update/pullAll.txt @@ -31,8 +31,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - If a ``<value>`` to remove is a document or an array, :update:`$pullAll` removes only the elements in the array that match the specified ``<value>`` exactly, including order. diff --git a/source/reference/operator/update/push.txt b/source/reference/operator/update/push.txt index ef506529ef9..43cf9323f16 100644 --- a/source/reference/operator/update/push.txt +++ b/source/reference/operator/update/push.txt @@ -28,8 +28,6 @@ Definition Behavior --------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - If the field is absent in the document to update, :update:`$push` adds the array field with the value as its element. diff --git a/source/reference/operator/update/rename.txt b/source/reference/operator/update/rename.txt index e3594dd2a40..8f7351e0749 100644 --- a/source/reference/operator/update/rename.txt +++ b/source/reference/operator/update/rename.txt @@ -37,8 +37,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - The :update:`$rename` operator logically performs an :update:`$unset` of both the old name and the new name, and then performs a :update:`$set` operation with the new name. As such, the operation may diff --git a/source/reference/operator/update/set.txt b/source/reference/operator/update/set.txt index 7ebdb2ceaef..22a056615f0 100644 --- a/source/reference/operator/update/set.txt +++ b/source/reference/operator/update/set.txt @@ -32,11 +32,11 @@ Definition .. include:: /includes/use-dot-notation.rst + + Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - If the field does not exist, :update:`$set` will add a new field with the specified value, provided that the new field does not violate a type constraint. diff --git a/source/reference/operator/update/setOnInsert.txt b/source/reference/operator/update/setOnInsert.txt index 4dae071a078..ffda9616a64 100644 --- a/source/reference/operator/update/setOnInsert.txt +++ b/source/reference/operator/update/setOnInsert.txt @@ -35,11 +35,6 @@ Definition .. include:: /includes/use-dot-notation.rst -Behavior --------- - -.. include:: /includes/fact-update-operator-lexicographic-order.rst - Example -------- diff --git a/source/reference/operator/update/slice.txt b/source/reference/operator/update/slice.txt index 753b0aa1a8c..820bb606513 100644 --- a/source/reference/operator/update/slice.txt +++ b/source/reference/operator/update/slice.txt @@ -58,8 +58,6 @@ $slice Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - The order in which the modifiers appear is immaterial. Previous versions required the :update:`$each` modifier to appear as the first modifier if used in conjunction with :update:`$slice`. For a list of diff --git a/source/reference/operator/update/sort.txt b/source/reference/operator/update/sort.txt index ab7b5ef9a0b..2b61c1b4eea 100644 --- a/source/reference/operator/update/sort.txt +++ b/source/reference/operator/update/sort.txt @@ -47,8 +47,6 @@ $sort Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - The :update:`$sort` modifier can sort array elements that are not documents. In previous versions, the :update:`$sort` modifier required the array elements be documents. diff --git a/source/reference/operator/update/unset.txt b/source/reference/operator/update/unset.txt index 20474fb5b13..5169c6892c9 100644 --- a/source/reference/operator/update/unset.txt +++ b/source/reference/operator/update/unset.txt @@ -36,8 +36,6 @@ Definition Behavior -------- -.. include:: /includes/fact-update-operator-lexicographic-order.rst - If the field does not exist, then :update:`$unset` does nothing (i.e. no operation).