Hello i'm trying to get data by a dynamic Cypher query.. However got an exception like:
org.neo4j.rest.graphdb.query.CypherTransactionExecutionException: Error executing cypher statements [{code=Neo.ClientError.Statement.InvalidSyntax, message=Invalid input '{': expected whitespace or a label name (line 1, column 54)
"MATCH (parentNode:ParentEntity)-[:HAS_A]->(childNode:{dynamicChildEntityType})= WHERE id(parentNode)={parentNodeId} RETURN childNode order by childNode.orderNr"
^}]
while trying to call method:
@Override
public List<ChildEntity> getChildrenOf(Long parentNodeId, String dynamicChildEntityType) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("dynamicChildEntityType", dynamicChildEntityType);
params.put("parentNodeId", parentNodeId);
String cql = "MATCH (parentNode:ParentEntity)-[:HAS_A]->(childNode:{dynamicChildEntityType})= WHERE id(parentNode)={parentNodeId} RETURN childNode order by childNode.orderNr";
return parentRepository.query(cql, params).as(List.class);
}
can you see what is wrong? Can't i use parameters for labels? If so, what do you suggest?
Thanks in advance.
Note: i'm using Neo4j v2.1.6 over Rest Api.