如何在oriento中选择或更新多条记录?就像在水线上我们可以
offersModel.update({id:items_ids,status:INACTIVE},{status:ACTIVE})
但在水线交易是不可用的。所以我想使用:
var db = offersModel.getDB();
var trans = db.begin();
trans.update('offers')
.set({status:INACTIVE})
.where({id:items_ids,status:ENM.SELLING_STATUS.ACTIVE})//.exec()
.then(function(offers){
if (offers.length != items_ids.length) {trans.rollback(); /* send error here*/}
else trans.commit();
})
谢谢。
发布于 2016-06-24 18:21:54
尝尝这个
db.update(id).set({status:INACTIVE}).scalar()
发布于 2016-05-27 20:07:36
你试过追随吗?
db.update(id).set({status:INACTIVE}).scalar()
https://stackoverflow.com/questions/29446477
复制相似问题