I'd like to know how to delete all values in an array, my array contains the ids like: [1,2,3,4], I've tried:
models.products
.destroy({where: {req.body.ids}})
.then(function(data){ res.json(data) })
But I got data undefined, and nothing is deleted...
You've missed the id from your criteria.
Model.destroy({ where: { id: [1,2,3,4] }})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With