Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update an array element with an array in mongoose

db.inventory.updateOne(
   { _id: 2 },
   { $addToSet: { tags: { $each: [ "camera", "electronics", "accessories" ] } } }
 )
Source by www.mongodb.com #
 
PREVIOUS NEXT
Tagged: #update #array #element #array #mongoose
ADD COMMENT
Topic
Name
7+4 =