在cypher语句中复制Neo4j浏览器自动完成功能 [英] Replicate Neo4j browser auto-complete function in a cypher statement
问题描述
我试图仅使用密码查询来复制neo4j浏览器界面的自动完成"功能.成功的实现将意味着,如果在浏览器中执行查询,则切换自动完成按钮将无效,因为在查询中指定了所有附加关系".
I am trying to replicate the "auto-complete" functionality of the neo4j browser interface using only a cypher query. A successful implementation would mean that if the query is executed in the browser, toggling the auto-complete button would have no effect, as all "additional relationships" are specified in the query.
我使用浏览器为查询创建原型,然后使用RNeo4j来实现它们.理想情况下,我希望RNeo4j结果与浏览器结果(包括自动完成)相匹配.
I use the browser to prototype the queries, then use RNeo4j to implement them. Ideally, I'd like the RNeo4j result to match the browser result including auto-complete.
作为示例,请考虑以下查询:
As an example, consider the query:
`MATCH p = (n:label1 {name:'tom'})-[r*2..3]-(n:label1 {name:'jerry'})
RETURN p`
在浏览器中,关闭自动完成功能后,我只会得到我所要求的(按预期方式),而打开自动完成功能时,我会得到路径上任何节点之间的所有关系,而这两个节点都不是汤姆"或杰里".
In the browser, with auto-complete turned off, I only get what I asked for (as expected), whereas when auto-complete is turned on, I get all relationships between any nodes on the path where neither node is "tom" or "jerry".
我尝试使用WITH
,然后使用第一个MATCH
之后的第二个MATCH
,但这不会产生我需要的结果.
I have tried using WITH
followed by a second MATCH
following the first MATCH
but this does not yield the results I require.
任何帮助都将不胜感激!
Any help greatly appreciated!
推荐答案
自动完成功能再次调用以获取其当前具有的所有节点ID之间的关系
the autocomplete feature makes another call to get the relationships between all the node ids it currently has
match a-[r]-b where id(a) in [1,2...] and id(b) in [1,2,3...] return r
这篇关于在cypher语句中复制Neo4j浏览器自动完成功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!