Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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

User.update( 
    { "_id" : userID} , 
    { "$pull" : { "teams" : { "_id" :  teamID } } } , 
    { "multi" : true }  
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #object #array #objects #mongoose
ADD COMMENT
Topic
Name
6+6 =