orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 67 forks source link

Add transaction variable $t1 to a list #165

Open StarpTech opened 8 years ago

StarpTech commented 8 years ago
 .let('t3', function(e) {
        e.update('Node')
          .add('References', '$t1')
          .where({ Mid: sponsorNode.mid });
      })
 .let('t3', function(e) {
        e.update('Node')
          .set('Field', '$t2')
      })
....

The $t1 is always converted to a string "$t1". I want to reuse the record behind this variable.

StarpTech commented 8 years ago

It seems that the fluent api isnt optimized with the transaction api. We could introduce a object called TransactionVariable to treat this case.

StarpTech commented 8 years ago

Something like:

 .let('t3', function(e) {
        e.update('Node')
          .add('References', TransactionVariable('$t0'))
          .where({ Mid: sponsorNode.mid });
      })
wolf4ood commented 8 years ago

+1