如何使用sequelize检查记录是否更新



在这段代码中,我更新了一个模型的记录IPAdress.

如何检查记录是否已更新

let IPAdress = await model.IPAdress.update(data,{ where: { id } });
if index 0 of an array is 0 then it mean that record has not updtaed yet.
let IPAdress = await model.IPAdress.update(data,{ where: { id } });
if(IPAdress[0] == 0) throw "Error Message";
else { print("record has been updated ");

相关内容

  • 没有找到相关文章

最新更新