File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
source/reference/operator Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ $addToSet
99 The :operator:`$addToSet` operator adds a value to an array only *if* the
1010 value is *not* in the array already. If the value *is* in the
1111 array, :operator:`$addToSet` returns without modifying the
12- array. Otherwise, :operator:`$addToSet` behaves the same as
13- :operator:`$push`. Consider the following example:
12+ array. Consider the following example:
1413
1514 .. code-block:: javascript
1615
@@ -20,5 +19,11 @@ $addToSet
2019 ``field``, *only if* ``value1`` is not already a member of this
2120 array.
2221
23- .. see:: :operator:`$each`
22+ .. note::
23+
24+ :operator:`$addToSet` only ensures that there are no duplicate
25+ items in a set and makes no guarantees regarding the order of
26+ the elements in the set.
27+
28+ .. see:: :operator:`$each` and :operator:`$push`
2429
You can’t perform that action at this time.
0 commit comments