Hi all. My usecase requires that I run any given neo4j cypher query on my application and I am providing some filters over these queries. For that I am using the aliases for each node/edge in the user entered cypher query.
But if the user doesnot mention any alias, then my filtering condition would not be applied on that particular node/edge.
eg: match (a:NODE_1)-[:Has]-(:NODE_2) return path.
Filtered query: match (a:NODE_1)-[:Has]-(:NODE_2) where a.SOME_CONDITION = 'zyx' return path
Here I wont be able to apply filter on the node_2 node and Has edge and thus my result might be incorrect.
Is there some way using the neo4j-cypher-dsl library(or some other way) that i can add aliases to the missing nodes/edges in query? If so, please help me with that. Thanks.
Sorry thats not what I intended to ask. I am building an application where a user can enter a cypher query and I have to modify it so as to add some filtering conditions or some other modifications according to the usecase.
So if a user enters match (a:NODE_1)-[:Has]-(:NODE_2) return path then i will be getting this as the query string. Now I have to modify this query to add aliases to all the missing nodes/edges. I know this can be achieved using java using regex match but i was wondering if neo4j cyherdsl library supports such a functionality. @glilienfield
Here is code a pulled from the first page of the manual. The first line creates a Movie node aliased to 'm'.
var m = Cypher.node("Movie").named("m");
var statement = Cypher.match(m)
.returning(m)
.build();
assertThat(cypherRenderer.render(statement))
.isEqualTo("MATCH (m:`Movie`) RETURN m");