Last active
January 11, 2017 12:49
-
-
Save onegrx/64de5ccc75ee85f362a0288935147f5e to your computer and use it in GitHub Desktop.
Neo4j examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (movie:Movie) | |
WHERE movie.year = 2016 | |
RETURN movie.title AS title | |
ORDER BY title ASC LIMIT 25 | |
MATCH (m:Movie {title: "Star Wars"})<-[:DIRECTED]-(p:Person {}) | |
RETURN p.name, m.title | |
MATCH (a:Person {name: "Emma Watson II"})-[:ACTED_IN]-(m)<-[:ACTED_IN]-(coActors) | |
RETURN coActors.name | |
MATCH (a:Person {name: "Emma Watson II"})-[:ACTED_IN]-(m)<-[:ACTED_IN]-(coActors) | |
WITH coActors.name as name, count(m) as movies | |
WHERE movies > 2 | |
RETURN name | |
MATCH (a:Person {name: "Emma Watson II"})-[:ACTED_IN]-(m)<-[:ACTED_IN]-(coActors) | |
WITH coActors, count(m) as movies | |
WHERE movies > 2 | |
RETURN coActors | |
MATCH (bacon:Person { | |
name:"Kevin Bacon I"})-[*1..2]-(hollywood) | |
RETURN DISTINCT hollywood, bacon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment