是否可以通过Neo4j的Web界面或shell传递参数和密码查询?例如,是否可以让Neo4j的Web界面执行此语句?
return {test};
Run Code Online (Sandbox Code Playgroud)
在Web界面中运行此语句会导致错误:
Expected a parameter named test
Neo.ClientError.Statement.ParameterMissing
Run Code Online (Sandbox Code Playgroud)
理想情况下,我想做的事情如下:
{ test: "foo" } // specify the parameters I would normally pass via the REST API
// my normal query
return {test};
Run Code Online (Sandbox Code Playgroud)
有没有办法做到这一点?我想这样做是因为我在Neo4j上使用REST API并且所有查询都采用参数.如果我想在Web界面或shell上测试我的任何查询,我需要手动编辑查询以用声明或原始输入替换{parameter}标记with.我希望能够简单地将我的查询复制/粘贴到Web界面中,提供一组参数并让它工作.
有谁知道这样做的方法?
我有一个数据模型,它是一个树结构,最大深度为3。例如:
(a) ... first level root node
/ | \
/ | \
(b) (b) (b) ... [0..n] number of second depth nodes
/ | |
/ | |
(c) (c) (c) ... [0..n] number of third depth nodes per (b) node
Run Code Online (Sandbox Code Playgroud)
节点之间的关系是: (c)-[:in]->(b)-[:in]->(a)
给定一个根节点(a),我想创建一个查询,该查询将返回最近的10个(b)节点以及每个(b)节点上的3个最近的(c)节点。
我从一个查询开始,以获取最近的10个(b)节点:
match (a) where id(a) = {root_id}
match (a)<-[:in]-(b) where b is not null
return b order by id(b) desc limit 10
Run Code Online (Sandbox Code Playgroud)
这将按预期获得最近的10个b节点。但是,我找不到一种方法来获取每(b)个最近的3个(c)节点。这就是我所拥有的:
match (a) where id(a) = {root_id}
match (a)<-[:in]-(b) where b is not …Run Code Online (Sandbox Code Playgroud)