orientjs icon indicating copy to clipboard operation
orientjs copied to clipboard

db.qery gives unhandled exception

Open aschwietert opened this issue 7 years ago • 1 comments

I tried the statement in OrientDB Studio and it works fine but OrientJS seems not be able to handle the response?

Edit: Using OrientDB v3 RC1

Code:

odb.query(
    'SELECT FROM (TRAVERSE in("Following") FROM #'+userid+') WHERE @rid != #'+userid).then(function(users){
    res.send(users)
 }); 

Error:

Unhandled rejection OrientDB.RequestError: Error on execution of command: sql.SELECT FROM (TRAVERSE in("Following") FROM #22:529) WHERE @rid != #22:529
        DB name="smnv3"
    at child.Operation.parseError (C:\Users\Alex\Downloads\SMN\SMNDB\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:896:13)
    at child.Operation.consume (C:\Users\Alex\Downloads\SMN\SMNDB\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:487:35)
    at Connection.process (C:\Users\Alex\Downloads\SMN\SMNDB\node_modules\orientjs\lib\transport\binary\connection.js:423:17)
    at Connection.handleSocketData (C:\Users\Alex\Downloads\SMN\SMNDB\node_modules\orientjs\lib\transport\binary\connection.js:314:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)

aschwietert avatar Jan 13 '18 20:01 aschwietert

@aschwietert

I guess if it works on Studio it's a problem of compatibility.

OrientJS 2.2.10, does not handle the new OrientDB 3.0 protocol with the new parser/executor

Btw the first version of OrientJS 3.0 is now available in beta with nested projection and OrientDB 3.0 features support

Here it's the release

and the documentation

wolf4ood avatar Jul 03 '18 11:07 wolf4ood