orientjs icon indicating copy to clipboard operation
orientjs copied to clipboard

Documentation Change: Transaction Builder with orientdb v3.X.X

Open creisle opened this issue 6 years ago • 0 comments

orientjs version

v3.0.4

orientdb version

v3.0.14

OS version

Centos07

Following the examples here http://orientdb.com/docs/3.0.x/orientjs/OrientJS-Transactions.html I am migrating code that previously worked with orientdb 2.X.X. However now the same function will no longer work, Could we add to the documentation a note to specify this to users?

Using orientdb v2 the documentation example works, in v3 I need to change

.let('career', function(c){
      c.create('edge', 'playsFor')
         .from('$player')
         .to('$team')
         .set({
            startYear: '1905',
            endYear:   '1926'
         })
   })

to

.let('career', function(c){
      c.create('edge', 'playsFor')
         .from('$player[0]')
         .to('$team[0]')
         .set({
            startYear: '1905',
            endYear:   '1926'
         })
   })

Because create now returns a record list not a single record (as far as I can tell)

This is related to https://github.com/orientechnologies/orientdb/issues/8786

creisle avatar Feb 26 '19 22:02 creisle