Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
neo4j密码匹配命令串联_Neo4j_Cypher - Fatal编程技术网

neo4j密码匹配命令串联

neo4j密码匹配命令串联,neo4j,cypher,Neo4j,Cypher,这两个Chypher语句是否相同: //first match (a)-[r]->(b),b-[r2]->c //second match (a)-[r]->(b) match b-[r2]->c 这两个Cypher语句不完全相同。我们可以通过使用来展示这一点,它向您展示了密码引擎将如何执行查询 在以下示例中,查询都以返回a,c结束,因为您不能有一个空的匹配子句 如您所见,第一个查询具有第二个查询没有的NOT(r==r2)过滤器。这是因为Cypher确保单个MATCH

这两个Chypher语句是否相同:

//first
match (a)-[r]->(b),b-[r2]->c

//second
match (a)-[r]->(b)
match b-[r2]->c

这两个Cypher语句不完全相同。我们可以通过使用来展示这一点,它向您展示了密码引擎将如何执行查询

在以下示例中,查询都以
返回a,c
结束,因为您不能有一个空的
匹配
子句

如您所见,第一个查询具有第二个查询没有的
NOT(r==r2)
过滤器。这是因为Cypher确保单个
MATCH
子句的结果不包含重复的关系

  • 第一个问题

    profile match (a)-[r]->(b),b-[r2]->c return a,c;
    ==> +-----------------------------------------------+
    ==> | a                     | c                     |
    ==> +-----------------------------------------------+
    ==> | Node[1]{name:"World"} | Node[0]{name:"World"} |
    ==> +-----------------------------------------------+
    ==> 1 row
    ==> 2 ms
    ==> 
    ==> Compiler CYPHER 2.3
    ==> 
    ==> Planner COST
    ==> 
    ==> Runtime INTERPRETED
    ==> 
    ==> Projection
    ==>   |
    ==>   +Filter
    ==>     |
    ==>     +Expand(All)(0)
    ==>       |
    ==>       +Expand(All)(1)
    ==>         |
    ==>         +AllNodesScan
    ==> 
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==> |       Operator | EstimatedRows | Rows | DbHits |    Identifiers |          Other |
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==> |     Projection |             1 |    1 |      0 | a, b, c, r, r2 |           a; c |
    ==> |         Filter |             1 |    1 |      0 | a, b, c, r, r2 |   NOT(r == r2) |
    ==> | Expand(All)(0) |             1 |    2 |      4 | a, b, c, r, r2 | (b)-[r2:]->(c) |
    ==> | Expand(All)(1) |             2 |    2 |      8 |        a, b, r |  (b)<-[r:]-(a) |
    ==> |   AllNodesScan |             6 |    6 |      7 |              b |                |
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==> 
    
    配置文件匹配(a)-[r]->(b),b-[r2]->c返回a,c;
    ==> +-----------------------------------------------+
    ==>| a | c|
    ==> +-----------------------------------------------+
    ==>|节点[1]{name:“World”}节点[0]{name:“World”}|
    ==> +-----------------------------------------------+
    =>1行
    =>2毫秒
    ==> 
    ==>编译器密码2.3
    ==> 
    ==>规划师成本
    ==> 
    ==>运行时解释
    ==> 
    ==>投影
    ==>   |
    ==>+滤波器
    ==>     |
    ==>+扩展(全部)(0)
    ==>       |
    ==>+扩展(全部)(1)
    ==>         |
    ==>+所有节点扫描
    ==> 
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==>|运算符|估计数drows |行|数据命中数|标识符|其他|
    ==> +----------------+---------------+------+--------+----------------+----------------+
    =>|投影| 1 | 1 | 0 | a、b、c、r、r2 | a;c|
    =>|过滤器| 1 | 1 | 0 | a、b、c、r、r2 |非(r==r2)|
    ==>|扩展(全部)(0)| 1 | 2 | 4 | a、b、c、r、r2 |(b)-[r2:]->(c)|
    =>|扩展(全部)(1)| 2 | 2 | 8 | a、b、r |(b)|所有节点都可以| 6 | 6 | 7 |b ||
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==> 
    
  • 第二个问题

    profile match (a)-[r]->(b) match b-[r2]->c return a,c;
    ==> +-----------------------------------------------+
    ==> | a                     | c                     |
    ==> +-----------------------------------------------+
    ==> | Node[1]{name:"World"} | Node[1]{name:"World"} |
    ==> | Node[1]{name:"World"} | Node[0]{name:"World"} |
    ==> +-----------------------------------------------+
    ==> 2 rows
    ==> 2 ms
    ==> 
    ==> Compiler CYPHER 2.3
    ==> 
    ==> Planner COST
    ==> 
    ==> Runtime INTERPRETED
    ==> 
    ==> Projection
    ==>   |
    ==>   +Expand(All)(0)
    ==>     |
    ==>     +Expand(All)(1)
    ==>       |
    ==>       +AllNodesScan
    ==> 
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==> |       Operator | EstimatedRows | Rows | DbHits |    Identifiers |          Other |
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==> |     Projection |             1 |    2 |      0 | a, b, c, r, r2 |           a; c |
    ==> | Expand(All)(0) |             1 |    2 |      4 | a, b, c, r, r2 | (b)-[r2:]->(c) |
    ==> | Expand(All)(1) |             2 |    2 |      8 |        a, b, r |  (b)<-[r:]-(a) |
    ==> |   AllNodesScan |             6 |    6 |      7 |              b |                |
    ==> +----------------+---------------+------+--------+----------------+----------------+
    
    配置文件匹配(a)-[r]->(b)匹配b-[r2]->c返回a,c;
    ==> +-----------------------------------------------+
    ==>| a | c|
    ==> +-----------------------------------------------+
    ==>|节点[1]{name:“World”}节点[1]{name:“World”}|
    ==>|节点[1]{name:“World”}节点[0]{name:“World”}|
    ==> +-----------------------------------------------+
    =>2行
    =>2毫秒
    ==> 
    ==>编译器密码2.3
    ==> 
    ==>规划师成本
    ==> 
    ==>运行时解释
    ==> 
    ==>投影
    ==>   |
    ==>+扩展(全部)(0)
    ==>     |
    ==>+扩展(全部)(1)
    ==>       |
    ==>+所有节点扫描
    ==> 
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==>|运算符|估计数drows |行|数据命中数|标识符|其他|
    ==> +----------------+---------------+------+--------+----------------+----------------+
    ==>|投影| 1 | 2 | 0 | a、b、c、r、r2 | a;c|
    ==>|扩展(全部)(0)| 1 | 2 | 4 | a、b、c、r、r2 |(b)-[r2:]->(c)|
    =>|扩展(全部)(1)| 2 | 2 | 8 | a、b、r |(b)|所有节点都可以| 6 | 6 | 7 |b ||
    ==> +----------------+---------------+------+--------+----------------+----------------+
    

  • 是的,它们是一样的。哦,知道这一点太棒了,谢谢!我刚刚检查了一下,
    (a)-[r]->(b),b-[r2]->c
    似乎与
    (a)-[r]->(b)-[r2]->c
    相同,这很有意义。