NEO4J creating, inserting, adding a key, deleting, editing
NEO4J basics of working with a graph-oriented NO SQL database
delete all connected nodes
match (n)-[r]-() DELETE n,r
delete all unconnected nodes (only if any remain)
match n DELETE n
create a node with the User label and property id:1 and 2
create (n:User {id:1})
create (n:User {id:2})
join with a follow edge (connect the nodes with property =1 and =2)
MATCH (a {id : 1}), (b {id : 2}) MERGE (a)-[r:follow]->(b) ;
create a CONSTRAINT and indexes
CREATE CONSTRAINT ON(u : User)ASSERT u . id IS UNIQUE ;
find all users (all nodes)
MATCH (n:`User`) RETURN n LIMIT 25
(maximum 25 nodes)
Comments