Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongodb pull multiple

await Model.findByIdAndUpdate(id, {
  $pull: {
    '<array-name>': {
      '<field-to-match>': {
         $in: ['val-1', 'val-2', ...]
      }
    }
  }
})
 
PREVIOUS NEXT
Tagged: #mongodb #pull #multiple
ADD COMMENT
Topic
Name
6+8 =