remove objectid from array mongoose code example
Example 1: mongoose delete object from array
doc.subdocs.push({ _id: 4815162342 }) // added
doc.subdocs.pull({ _id: 4815162342 }) // removed
Example 2: how to remove one object in an array of objects in mongoose
User.update(
{ "_id" : userID} ,
{ "$pull" : { "teams" : { "_id" : teamID } } } ,
{ "multi" : true }
)