Answers for "add multiple subdocument mongoose"

0

add multiple subdocument mongoose

#not duplicate value
db.getCollection('profilesservices').updateOne({_id: ObjectId("603ce3bf9323e811c86cb7c8")}, {
 $addToSet: {"jobPreferences.jobInterests": {$each: ["mobile developer", "backend developer"]} }    
})

# with duplicate value
db.getCollection('profilesservices').updateOne({_id: ObjectId("603ce3bf9323e811c86cb7c8")}, {
 $push: {"jobPreferences.jobInterests": {$each: ["mobile developer", "backend developer"]} }    
})
Posted by: Guest on March-01-2021

Code answers related to "add multiple subdocument mongoose"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language