orientjs icon indicating copy to clipboard operation
orientjs copied to clipboard

Add transaction variable $t1 to a list

Open StarpTech opened this issue 8 years ago • 3 comments

 .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 avatar Apr 04 '16 19:04 StarpTech

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

StarpTech avatar Apr 04 '16 19:04 StarpTech

Something like:

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

StarpTech avatar Apr 04 '16 19:04 StarpTech

+1

wolf4ood avatar Apr 05 '16 12:04 wolf4ood