2017-08-31 4 views
0

Ich arbeite mit OrientJS und ich versuche, eine Kante zwischen zwei Knoten zu erstellen. Bis vor einigen Tagen, alle funktionierte gut mit dem Skript unten:Kann EDGE in Orientjs nicht erstellen

module.exports.insertRelatedToAssociation = (nodeFrom, nodeTo) => { 
    db.create('EDGE', 'RelatedTo') 
     .from(nodeFrom).to(nodeTo) 
     .one() 
     .then(function (result) { 
      return (result !== undefined) 
     })  
} 

Aber jetzt, ich diese Fehlermeldung plötzlich erhalten jedes Mal laufe ich das Skript:

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) 

Vielleicht Orientdb seine Parser geändert, aber Ich habe nichts über das GitHub Wiki gefunden (https://github.com/orientechnologies/orientdb/wiki/OrientDB-2.2-Release-Notes#2226---august-16-2017).

Hinweis: Ich führe die Orientdb-Community-Importeure-2.2.24. Das Gleiche gilt für die Version 2.2.26.

Antwort

0

Ich habe den Fehler gefunden. Es war einfach so, dass der Parameter nodeFromundefined war. Übergeben Sie undefined zu db.create('EDGE','RelatedTo).from(undefined).to(nodeTo), produzieren Sie diesen Fehler!