Search code examples
ruby-on-railsneo4jcypherneography

Is there a way to see the string version of a parameterized cypher query?


In Ruby on Rails, using NeoGraphy, I'm constructing a parameterized cypher query and getting back a result.

@results = $neo.execute_query(query, parameters)

Using gon, I put all these to the client and checked them out in the javascript console:

gon.results = @results
gon.search_query = query
gon.search_parameters = parameters

gon.search_query is just what I see in the .rb file, so I guess that means cypher takes that and takes the parameters and then creates the query. Can I get to the string version of the query that must be created by using the parameter values?

The reason I want this is so that I can paste it into the neo4j web admin console tool and tweak it.

Thanks!


Solution

  • Perhaps the simplest way to accomplish that is to write your own print method that given the query and the parameters would print the expanded query. And you can call it before / after the $neo.execute_query