1.
Cypher's Query
1.1 Query statements for statistical relationships: match (m)-[r]-> (n) return type (R), COUNT (*)
Get the results
"Type (R)" │ "count (*)" │
╞══════════╪══════════╡
│ "produced" │ "
├──────────┼──────────┤
│" "Reviewed" │ "8" │
├──────────┼──────────┤
│ "follows" │ "3" │
├──────────┼──────────┤
│ Wrote " │" 9 " │
├──────────┼──────────┤
│" acted_in "│" 172 "
│ ├──────────┼──────────┤
│ "directed" │ "
└──────────┴──────────┘" │
Similarly, a query statement to a node: match (N:person) return count (*)
Result is
╒══════════╕
│ "COUNT (*)" │
╞══════════╡ │
"131" │
└──────────┘
Deletion of 2.Cypher
Cypher deletion must first delete the relationship
2.1 Delete all node statements as: Match (m)-[r]-> (n) Delete m,r,n
Result is
Deleted 169 nodes, Deleted relationships, statement completed in Ms.
Otherwise, specify a delete node, such as specifying a delete relationship
Match (M)-[r:roled_in]-> (n) Delete R is a roled_in relationship for deleting a relationship
Similarly, deleting other relationships is the node that specifies the deletion.
3 Creating nodes
Create (Thematrix:movie {title: ' The Matrix ', released:1999, tagline: ' Welcome to the Real World '}) creating nodes
Create (Keanu:person {name: ' Keanu Reeves ', born:1964}) Creating nodes
CREATE
(Keanu)-[:acted_in {roles:[' Neo ']}]-> (Thematrix) to create a relationship.
So you get a triple-group relationship <Keanu,ACTED_IN,TheMatrix>