Skip to content

Instantly share code, notes, and snippets.

@jmfloreszazo
Created October 28, 2022 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmfloreszazo/cdccdf8785b6d11b7fdd6f4788cba1be to your computer and use it in GitHub Desktop.
Save jmfloreszazo/cdccdf8785b6d11b7fdd6f4788cba1be to your computer and use it in GitHub Desktop.
dotNetMLG
MATCH (n) -[r] -> () DELETE n, r
MATCH (n) DELETE n
CREATE(CityA:City { name: "City-A"})
CREATE(CityB:City { name: "City-B"})
CREATE(P1:Person { name: "Person-1"})
CREATE(P2:Person { name: "Person-2"})
CREATE(P3:Person { name: "Person-3"})
CREATE(P4:Person { name: "Person-4"})
CREATE(P5:Person { name: "Person-5"})
CREATE
(CityA)-[:BORN]->(P1),
(CityA)-[:BORN]->(P3),
(CityA)-[:BORN]->(P5)
CREATE
(CityB)-[:BORN]->(P2),
(CityB)-[:BORN]->(P4)
CREATE(EmployerA:Employer { name: "Employer-A"})
CREATE(EmployerB:Employer { name: "Employer-B"})
CREATE(EmployerC:Employer { name: "Employer-C"})
CREATE
(EmployerA)-[:EMPLOYED]->(P1),
(EmployerA)-[:EMPLOYED]->(P5),
(EmployerB)-[:EMPLOYED]->(P1),
(EmployerB)-[:EMPLOYED]->(P3),
(EmployerB)-[:EMPLOYED]->(P5),
(EmployerC)-[:EMPLOYED]->(P2),
(EmployerC)-[:EMPLOYED]->(P5)
MATCH (n) RETURN n
MATCH (n) MATCH (n)-[r]-() RETURN n, r
MATCH(city:City { name: "City-B"})-[:BORN]->(person:Person)<-[:EMPLOYED]-(employer:Employer)
RETURN distinct person.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment