Waterline Transaction through sails-orientdb
问题 I'm using transaction in the following code, can I enhance this code furthermore? var db = itemsModel.getDB(); var trans = db.begin(); trans.update('items') .set({status:UNAVAILABLE}) .where({id:items_ids_list,status:AVAILABLE}).exec() .then(function(items){ if (items.length != items_ids_list.length) { trans.rollback(); /* send error here*/ } else trans.commit(); }); 来源: https://stackoverflow.com/questions/29586175/waterline-transaction-through-sails-orientdb