How to use the API getCypher ? #233
-
I would like to know how to use the public API getCypher, the parameter needed, CypherEnvironment is only exported as a Type. Is there a workaround ? |
Beta Was this translation helpful? Give feedback.
Answered by
angrykoala
Nov 23, 2023
Replies: 1 comment 1 reply
-
You can wrap your query in a new Cypher.Raw((env) => {
const movieNode = new Cypher.Node({
labels: ["Movie"],
});
const matchQuery = new Cypher.Match(movieNode)
.where(movieNode, {
title: new Cypher.Param("The Matrix"),
})
.return(movieNode.property("title"));
console.log(matchQuery.getCypher(env))
}) Although |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another point is that while this is doable,
getCypher
is not really intended to be directly used and I would recommend usingenv.compile
within the callback ofCypher.Raw
as described here