In MongoDB, you can use the $pullAll
operator to remove all instances of the specified values from an existing array.
Use $pullAll
in conjunction with a method such as update()
, updateOne()
, or updateMany()
to update the specified document/s with the change.