Answers for "how to remove one object in an array of objects in mongoose"

0

how to remove one object in an array of objects in mongoose

User.update( 
    { "_id" : userID} , 
    { "$pull" : { "teams" : { "_id" :  teamID } } } , 
    { "multi" : true }  
)
Posted by: Guest on May-31-2021
0

mongoose delete object from array

doc.subdocs.push({ _id: 4815162342 }) // added
doc.subdocs.pull({ _id: 4815162342 }) // removed
Posted by: Guest on April-03-2021

Code answers related to "how to remove one object in an array of objects in mongoose"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language