Cyper clojure necons tquery:如何通过标签与{_variable}匹配?

时间:2015-10-13 19:53:56

标签: clojure neo4j cypher

我正在尝试使用clojure neocons来执行密码查询,我需要为标签使用变量占位符:

(def node-query "MATCH (n:{_nodetype})
                 RETURN n;")

我添加{_nodetype}时收到错误但删除{_nodetype}时没有错误

"Invalid input '{': expected whitespace or a label name (line 1, column 10 (offset: 9))\\n\\\"MATCH (n:{_nodetype})\\\"\\n ^\",\n \"exception\"...

以下是我对tquery的调用:

(cy/tquery conn node-query {:_nodeid _nodeid :_nodetype "Folder"})

带有变量的标签对MATCH的cypher / neocons语法是什么?

我非常感谢你能提出的建议。

1 个答案:

答案 0 :(得分:1)

您无法参数化标签(或关系类型)。这样做的基本原理是,不同的参数值可能会导致完全不同的查询计划。在内部,查询计划使用查询字符串缓存。

现在只需在Clojure中进行字符串连接即可拥有“半动态”标签或关系类型。

相关问题