Karol Selak
Karol Selak

Reputation: 4774

Is there sth like `eval` in Neo4j?

Can I evaluate cypher code from a string in Neo4j? I think about something like eval function in JavaScript.

Upvotes: 0

Views: 436

Answers (1)

stdob--
stdob--

Reputation: 29172

You will be helped by the apoc library with a rich set of tools to execute the cypher from the string:

call db.labels() yield label
call apoc.cypher.run("match (:`"+label+"`) return count(*) as count", null) yield value
return label, value.count as count

Upvotes: 3

Related Questions