Skip to content

Instantly share code, notes, and snippets.

@Lewuathe
Last active December 23, 2015 14:09
Show Gist options
  • Select an option

  • Save Lewuathe/6647155 to your computer and use it in GitHub Desktop.

Select an option

Save Lewuathe/6647155 to your computer and use it in GitHub Desktop.
= Cypher tutorial
This gist is for my Cypher learning.
// graph
// setup
[source,cypher]
----
CREATE (n:Actor {name:"Doraemon"})
----
// setup
[source,cypher]
----
MATCH (actor:Actor)
WHERE actor.name = "Doraemon"
CREATE (n:Actor {name:"Nobita"})
CREATE (actor)-[:HELP]->(n)
----
// setup
[source,cypher]
----
MATCH (actor:Actor)
WHERE actor.name = "Doraemon"
CREATE UNIQUE (actor)-[r:ACTED_IN]->(movie:Movie {title:"Mugen Sankenshi"})
RETURN r;
----
// setup
[source,cypher]
----
MATCH (actor:Actor)
WHERE actor.name = "Doraemon"
SET actor.birth_year = 2020
RETURN actor.name, actor.birth_year;
----
// setup
[source,cypher]
----
MATCH (actor:Actor)
RETURN actor as `All Actors`;
----
// console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment