如何修正AQL语法错误?我试图使用查询创建边缘,但出现以下错误:
执行查询失败。响应: 400,错误: 1501 - AQL:语法错误,查询字符串在1:57位置附近意外结束(解析时)
用于执行查询的代码:
try {
String query = "INSERT { _from:TurmaA._teste2, _to:TurmaA._testepedro } IN @edges";
Map<String, Object> bindVars = new MapBuilder().put("edges", nome2).get();
ArangoCursor<BaseDocument> cursor = arangoDB.db(dbName).query(query, bindVars,
null, BaseDocument.class);
cursor.forEachRemaining(aDocument -> {
System.out.println("Key: " + aDocument.getKey());
});
} catch (ArangoDBException e) {
System.err.println("Failed to execute query. " + e.getMessage());
}发布于 2019-02-26 13:46:06
请注意,@@。
因此,您的代码示例可能很容易修复如下:
try {
String query = "INSERT { _from:TurmaA._teste2, _to:TurmaA._testepedro } IN @@edges";
Map<String, Object> bindVars = new MapBuilder().put("@edges", nome2).get();
ArangoCursor<BaseDocument> cursor = arangoDB.db(dbName).query(query, bindVars,
null, BaseDocument.class);
cursor.forEachRemaining(aDocument -> {
System.out.println("Key: " + aDocument.getKey());
});
} catch (ArangoDBException e) {
System.err.println("Failed to execute query. " + e.getMessage());
}https://stackoverflow.com/questions/54864925
复制相似问题