Retrieve a graph (U—-M-—G—-M—U) with the movies that user Angela Thompson and Nicole Ramsey have rated and are related with drama

Yeah, my bad, I updated my last post, it should work:)

It exists! Thanks

Somehow i managed to graph it by finally writing the following code:

<>
MATCH (u1:User{name:"Angela Thompson"})
MATCH (u2:User{name:"Nicole Ramsey"})
MATCH (u1:User{name:"Angela Thompson"})-[:RATED]->(m1:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m2:Movie)<-[:RATED]-(u2:User{name:"Nicole Ramsey"})
RETURN *

Normally, you can do that:

MATCH (u1:User{name:"Angela Thompson"})
MATCH (u2:User{name:"Nicole Ramsey"})
MATCH (u1)-[:RATED]->(m1:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m2:Movie)<-[:RATED]-(u2)
RETURN *

Nice, so you can check if there are ratings > 1 on relationships:)

YES! It works and the code is shorter, fantastic! Thank you so much.

1 Like

Do you need help for anything else?

As soon as it pops up :smiley: THX!!

You can close this topic by accepting the message with the answer as answer and reopen a new one when you need it:)