【问题标题】:What is the appropriate cypher query?什么是适当的密码查询?
【发布时间】:2013-07-24 12:54:33
【问题描述】:

我正在尝试在

上运行 web ui

7474/webadmin/#

假设我想找到一个节点,它的属性“title”的值为“Home”。 如何使用密码查询找到该节点? (应该只有一个节点。)

另外,假设我想检索关系? 假设我有以下内容: A -entitledTo-> B -entitledTo-> C

我已经尝试过以下方法: start n=node(*) where n.title='Home' return n;

start c=node(node_c_id) match a-[:entitledTo]->b-[:entitledTo]->c return a,b,c;

但是,我收到此错误消息:节点 [0] 上不存在属性“标题”

我该如何解决这个问题?

最后,这是版本 2.0.0-M03

【问题讨论】:

    标签: neo4j cypher


    【解决方案1】:

    使用:

    start n=node(*) where has(n.title) and n.title='Home' return n
    

    一般你应该考虑使用索引来进行这种操作,Neo4j 的参考手册有很多关于这方面的信息。

    【讨论】:

      【解决方案2】:

      你可以使用:

      start n=node(*) where n.title! ='Home' return n;

      the section on missing properties in where clauses

      【讨论】:

        【解决方案3】:

        要检索关系,也许 Cypher PATH 命令会很有用。

        【讨论】:

          猜你喜欢
          • 2012-06-30
          • 1970-01-01
          • 1970-01-01
          • 2012-04-19
          • 2016-02-06
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多