how to remove one object in an array of objects in mongoose
User.update(
{ "_id" : userID} ,
{ "$pull" : { "teams" : { "_id" : teamID } } } ,
{ "multi" : true }
)
how to remove one object in an array of objects in mongoose
User.update(
{ "_id" : userID} ,
{ "$pull" : { "teams" : { "_id" : teamID } } } ,
{ "multi" : true }
)
mongoose delete object from array
doc.subdocs.push({ _id: 4815162342 }) // added
doc.subdocs.pull({ _id: 4815162342 }) // removed
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us