1

我正在尝试按照orientjs 文档中的建议使用 orientjs 执行批处理脚本,但出现以下错误:

Unhandled rejection OrientDB.RequestError: Cannot find a command executor for the command request: sql.begin;let $susers = select from susers;return $susers
    Storage URL="plocal:/Users/amyth/projects/orient/orientdb-community-2.2.0/databases/konnect"
    at Operation.parseError (/Users/amyth/projects/konnect/node_modules/orientjs/lib/transport/binary/protocol33/operation.js:865:13)
    at Operation.consume (/Users/amyth/projects/konnect/node_modules/orientjs/lib/transport/binary/protocol33/operation.js:455:35)
    at Connection.process (/Users/amyth/projects/konnect/node_modules/orientjs/lib/transport/binary/connection.js:399:17)
    at Connection.handleSocketData (/Users/amyth/projects/konnect/node_modules/orientjs/lib/transport/binary/connection.js:290:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at TCP.onread (net.js:542:20

对于一个简单的脚本:

begin;let $susers = select from susers;return $susers

难道我做错了什么 ?或者这是一个错误?

4

1 回答 1

3

尝试

db.query("begin;let $susers = select from susers;return $susers",{class: 's'}).then(function(res){
 console.log(res)
})

似乎最近更改了文档,省略了 {class: 's'}

于 2016-07-09T07:09:44.117 回答