Friday 9 June 2017

Mongoose - remove multiple documents in one function call

In documentation there's deleteMany() method

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

I want to remove multiple documents that have one common property and the other property vary. Something like this:

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

What would be the proper syntax for this?



via Maciej Krawczyk

No comments:

Post a Comment