sql delete - use bulkDestroy in Sequelize -
i'd know how delete values in array, array contains ids like: [1,2,3,4]
, i've tried:
models.products .destroy({where: {req.body.ids}}) .then(function(data){ res.json(data) })
but got data
undefined, , nothing deleted...
you've missed id
criteria.
model.destroy({ where: { id: [1,2,3,4] }})
Comments
Post a Comment