October 2017
Beginner to intermediate
316 pages
8h
English
Obviously, to create data, the keyword is CREATE, as we saw it earlier in our Shakespearean example:
CREATE (romeo:Person{name: "Romeo"})-[:LOVES]->(juliet:Person{name:"Juliet"})
Going from left to right in this example, a first node romeo, is created, with the label Person and one string property--name valued Romeo. Then, a relation LOVES is linking the first node to a second node, juliet.
A relation is always directed in Neo4j, so basically, we could create a second LOVES relation from juliet to romeo to model the story better, as follows:
CREATE (romeo:Person{name: "Romeo"})-[:LOVES]->(juliet:Person{name:"Juliet"})CREATE (juliet)-[:LOVES]->(romeo)RETURN romeo, juliet;
However, this is not mandatory. Not because love sometimes ...
Read now
Unlock full access