Skip to content

Commit 82a999f

Browse files
Gianfrancø Palumbokay-kim
authored andcommitted
Fix previous commit
1 parent 6a54069 commit 82a999f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/reference/operator/update/addToSet.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following :update:`$addToSet` operation on the non-array field
6060

6161
db.foo.update(
6262
{ _id: 1 },
63-
{ $addToSet: { colors: [ "c", "d" ] } }
63+
{ $addToSet: { colors: "c" } }
6464
)
6565

6666
Value to Add is An Array
@@ -83,7 +83,7 @@ The following operation appends the array ``[ "c", "d" ]`` to the
8383

8484
db.test.update(
8585
{ _id: 1 },
86-
{ $addToSet: { letters: "c" } }
86+
{ $addToSet: { letters: [ "c", "d" ] } }
8787
)
8888

8989
The ``letters`` array now includes the ``[ "c", "d" ]`` array

0 commit comments

Comments
 (0)