如何在oriento中选择或更新多个记录?就像我在水线一样
offersModel.update({id:items_ids,status:INACTIVE},{status:ACTIVE})
Run Code Online (Sandbox Code Playgroud)
但在水线交易不可用.所以我想用:
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();
})
Run Code Online (Sandbox Code Playgroud)
谢谢.
我只想知道是否可以使用水线选择特定字段,下面给出了orientdb查询.
e.g.
select phone from user
Run Code Online (Sandbox Code Playgroud)
我想通过使用此查询从用户顶点选择手机
userModel.find(phone)
.then(function(phonelist){
if(!phonelist)
console.log('msg: RECORD_NOT_FOUND');
else
console.log(phonelist);
.catch(function(err){ console.log('err: 'err'); });
Run Code Online (Sandbox Code Playgroud)