【发布时间】:2019-08-14 13:25:36
【问题描述】:
我有一个产品表,需要一次更新具有不同 ID 的多行。仍然,不知道我该如何实现。
module.exports = sequelize.define('products', {
product_id: {
type: Sequelize.INTEGER(20),
},
product_quantity: {
type: Sequelize.INTEGER(225),
},
})
var cart_list = [
{ id: 1, curr_quantity: 1 },
{ id: 2, curr_quantity: 4 },
{ id: 3, curr_quantity: 5 },
{ id: 4, curr_quantity: 2 }
]
Product.update({
product_quantity
})
.then(product => {
})
【问题讨论】:
标签: mysql orm sequelize.js