无法在 Orientjs 中创建 EDGE
Unable to create EDGE in Orientjs
我正在使用 OrientJS,我正在尝试在两个节点之间创建一条边。直到几天前,使用以下脚本一切正常:
module.exports.insertRelatedToAssociation = (nodeFrom, nodeTo) => {
db.create('EDGE', 'RelatedTo')
.from(nodeFrom).to(nodeTo)
.one()
.then(function (result) {
return (result !== undefined)
})
}
但是现在,我每次 运行 脚本时都会突然收到此错误消息:
com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
CREATE EDGE RelatedTo FROM #29:5
^
Encountered " <CREATE> "CREATE "" at line 1, column 1.
Was expecting one of:
<SELECT> ...
<TRAVERSE> ...
<MATCH> ...
<INSERT> ...
<RETURN> ...
<PROFILE> ...
<FIND> ...
<REBUILD> ...
<OPTIMIZE> ...
<GRANT> ...
<REVOKE> ...
<BEGIN> ...
<COMMIT> ...
<ROLLBACK> ...
<IF> ...
<SLEEP> ...
<CONSOLE> ...
DB name="test-graph"
at com.orientechnologies.orient.core.sql.parser.OStatementCache.throwParsingException(OStatementCache.java:109)
at com.orientechnologies.orient.core.sql.parser.OStatementCache.parse(OStatementCache.java:103)
at com.orientechnologies.orient.core.sql.parser.OStatementCache.get(OStatementCache.java:81)
at com.orientechnologies.orient.core.sql.parser.OStatementCache.get(OStatementCache.java:64)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLAbstract.preParse(OCommandExecutorSQLAbstract.java:232)
at com.orientechnologies.orient.graph.sql.OCommandExecutorSQLCreateEdge.parse(OCommandExecutorSQLCreateEdge.java:66)
at com.orientechnologies.orient.graph.sql.OCommandExecutorSQLCreateEdge.parse(OCommandExecutorSQLCreateEdge.java:46)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:58)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:39)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:3144)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:69)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1529)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:646)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:384)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:207)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)
也许,OrientDB 更改了它的解析器,但我在 GitHub Wiki (https://github.com/orientechnologies/orientdb/wiki/OrientDB-2.2-Release-Notes#2226---august-16-2017) 上没有找到任何相关信息。
注意:我正在 运行安装 orientdb-community-importers-2.2.24。 2.2.26版本也一样。
我发现了错误。只是参数 nodeFrom
是 undefined
。因此将 undefined
传递给 db.create('EDGE','RelatedTo).from(undefined).to(nodeTo)
会产生该错误!
我正在使用 OrientJS,我正在尝试在两个节点之间创建一条边。直到几天前,使用以下脚本一切正常:
module.exports.insertRelatedToAssociation = (nodeFrom, nodeTo) => {
db.create('EDGE', 'RelatedTo')
.from(nodeFrom).to(nodeTo)
.one()
.then(function (result) {
return (result !== undefined)
})
}
但是现在,我每次 运行 脚本时都会突然收到此错误消息:
com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
CREATE EDGE RelatedTo FROM #29:5
^
Encountered " <CREATE> "CREATE "" at line 1, column 1.
Was expecting one of:
<SELECT> ...
<TRAVERSE> ...
<MATCH> ...
<INSERT> ...
<RETURN> ...
<PROFILE> ...
<FIND> ...
<REBUILD> ...
<OPTIMIZE> ...
<GRANT> ...
<REVOKE> ...
<BEGIN> ...
<COMMIT> ...
<ROLLBACK> ...
<IF> ...
<SLEEP> ...
<CONSOLE> ...
DB name="test-graph"
at com.orientechnologies.orient.core.sql.parser.OStatementCache.throwParsingException(OStatementCache.java:109)
at com.orientechnologies.orient.core.sql.parser.OStatementCache.parse(OStatementCache.java:103)
at com.orientechnologies.orient.core.sql.parser.OStatementCache.get(OStatementCache.java:81)
at com.orientechnologies.orient.core.sql.parser.OStatementCache.get(OStatementCache.java:64)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLAbstract.preParse(OCommandExecutorSQLAbstract.java:232)
at com.orientechnologies.orient.graph.sql.OCommandExecutorSQLCreateEdge.parse(OCommandExecutorSQLCreateEdge.java:66)
at com.orientechnologies.orient.graph.sql.OCommandExecutorSQLCreateEdge.parse(OCommandExecutorSQLCreateEdge.java:46)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:58)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:39)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:3144)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:69)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1529)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:646)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:384)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:207)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)
也许,OrientDB 更改了它的解析器,但我在 GitHub Wiki (https://github.com/orientechnologies/orientdb/wiki/OrientDB-2.2-Release-Notes#2226---august-16-2017) 上没有找到任何相关信息。
注意:我正在 运行安装 orientdb-community-importers-2.2.24。 2.2.26版本也一样。
我发现了错误。只是参数 nodeFrom
是 undefined
。因此将 undefined
传递给 db.create('EDGE','RelatedTo).from(undefined).to(nodeTo)
会产生该错误!