Mongoose – remove multiple documents in one function call

I believe what youre looking for is the $in operator:

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

Documentation here: https://docs.mongodb.com/manual/reference/operator/query/in/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)