Skip to content

Commit 6a54069

Browse files
Gianfrancø Palumbokay-kim
authored andcommitted
docs($addToSet): use a simple example update for Field is Not an Array
https://docs.mongodb.com/manual/reference/operator/update/addToSet/#field-is-not-an-array
1 parent effae9a commit 6a54069

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/reference/operator/update/addToSet.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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", "d" ] } }
86+
{ $addToSet: { letters: "c" } }
8787
)
8888

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

0 commit comments

Comments
 (0)