Skip to content

Commit b3be1b9

Browse files
author
Kay Kim
committed
DOCS-12144: 4.0-4.0.4 behavior
1 parent 229492b commit b3be1b9

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

source/reference/operator/aggregation/arrayToObject.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ Definition
5656
Behavior
5757
--------
5858

59-
If the name of a field repeats in the array,
60-
:expression:`$arrayToObject` uses the first value for that field.
59+
If the name of a field repeats in the array, the value used depends on
60+
the driver.
6161

62-
For more information on expressions, see :ref:`aggregation-expressions`.
6362

6463
.. list-table::
6564
:header-rows: 1
@@ -106,6 +105,11 @@ For more information on expressions, see :ref:`aggregation-expressions`.
106105

107106
{ "item" : "123abc" }
108107

108+
If the name of a field repeats in the array, the value for the
109+
repeating field depends on the driver. In the
110+
:binary:`~bin.mongo` shell, the first value is used for the
111+
repeating field.
112+
109113

110114
Examples
111115
--------
@@ -142,15 +146,18 @@ document:
142146

143147
The operation returns the following:
144148

149+
.. note::
150+
151+
If the name of a field repeats in the array, the value for the
152+
repeating field depends on the driver. In the :binary:`~bin.mongo`
153+
shell, the first value is used for the repeating field.
154+
145155
.. code-block:: javascript
146156

147157
{ "_id" : 1, "item" : "ABC1", "dimensions" : { "l" : 25, "w" : 10, "uom" : "cm" } }
148158
{ "_id" : 2, "item" : "ABC2", "dimensions" : { "l" : 50, "w" : 25, "uom" : "cm" } }
149159
{ "_id" : 3, "item" : "ABC3", "dimensions" : { "l" : 50 } }
150160

151-
If the name of a field repeats in the array,
152-
:expression:`$arrayToObject` uses the first value for that field.
153-
154161
``$objectToArray`` + ``$arrayToObject`` Example
155162
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156163

0 commit comments

Comments
 (0)