Being crude with the data
This paragraph is not about swearing at a crew member of a well-known spaceship (while using a language with the name of a crew member of another spaceship). The acronym CRUD stands for Create, Read, Update, and Delete, which are the phases all data eventually goes through. This is the basis of what a database language must offer. This will give you the keys to use your own data. Let's go through the phases and discuss them BY ORDER.
Create data
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 labelPerson
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...