Mongoose - remove multiple documents in one function call

后端 未结 4 757
鱼传尺愫
鱼传尺愫 2021-01-03 17:55

In documentation there\'s deleteMany() method

Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }, function (err) {});

I want to remo

4条回答
  •  醉话见心
    2021-01-03 18:28

    Yes, $in is a perfect solution :

    Site.deleteMany({ userUID: uid, id: { $in: [10, 2, 3, 5] } }, function(err) {})

提交回复
热议问题