What is the difference between multiple MATCH clauses and a comma in a Cypher query?

后端 未结 5 737
死守一世寂寞
死守一世寂寞 2021-02-01 02:43

In a Cypher query language for Neo4j, what is the difference between one MATCH clause immediately following another like this:

MATCH (d:Document{document_ID:2})
         


        
5条回答
  •  孤城傲影
    2021-02-01 03:07

    There are no differences between these provided that the clauses are not linked to one another.

    If you did this:

    MATCH (a:Thing), (b:Thing) RETURN a, b;
    

    That's the same as:

    MATCH (a:Thing) MATCH (b:Thing) RETURN a, b;
    

    Because (and only because) a and b are independent. If a and b were linked by a relationship, then the meaning of the query could change.

提交回复
热议问题