Gunnar
Gunnar

Reputation: 18990

Identifying parameters of Cypher query

Is there an API for identifying the named parameters of a given Cypher query? When taking the following query as example:

MATCH (n) WHERE n.firstName = { name } AND n.LastName = { lastName } RETURN n

Then this API should return "name" and "lastName".

Does Neo4j provide such an API or would I have to manually parse the query string to identify any parameters it contains?

Upvotes: 0

Views: 142

Answers (2)

Christophe Willemsen
Christophe Willemsen

Reputation: 20185

Maybe you can begin your query with parameters in a transaction, get the result/errors and rollback it ?

http://docs.neo4j.org/chunked/stable/rest-api-transactional.html

Upvotes: 0

cybersam
cybersam

Reputation: 67009

There is no API for obtaining the names of the properties used in a Cypher query. There is generally no need for such a utility, since the code making the query should already know that information.

Upvotes: 1

Related Questions