cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

clem
Graph Steward

In this tutorial:

There is the query:

MATCH (a:Person), (m:Movie)
WHERE a.name = 'Michael Caine' AND m.title = 'Batman Begins'
CREATE (a)-[:ACTED_IN]->(m)
RETURN a, m

with an explanation that this query will create a cartesian product but it does NOT explain how to avoid that!

Avoiding a cartesian product is explained here:

(I would have made a Pull Request on it, but I don't know where it lives in github.)

3 Comments
dana_canzano
Neo4j
Neo4j

Yes that cypher statement does create a Cartesian join but it's a 1x1 Cartesian since each match returns only 1 row given the data model

clem
Graph Steward

That's not the point of my suggestion.

I got the warning but I didn't have any idea of how to fix it until today.

It's not immediately obvious how to not do a Cartesian Product.

benjamin_rood
Node Clone

@dana_canzano It's rather shameful when people wilfully miss the point and dismiss very reasonable issues in documentation. Not very good advert for your product, is it?