1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| # 创建一个 Person 对象,别名为a, 名字为 rstyro,年龄为23,性别 男 create (a:Person{name:"rstyro",age:23,sex:"男"}); create (a:Person{name:"rstyro",age:23,sex:"男"}) return a;
# 一次创建多个 对象, create (a:Person{name:"rstyro",age:23,sex:"男"}),(b:Person{name:"老婆",age:21,sex:"女"}); create (a:Person{name:"rstyro",age:23,sex:"男"}),(b:Person{name:"老婆",age:21,sex:"女"}) return a,b;
# 修改对象,name 为rstyro 的,修改 age 属性为 168 match (a:Person{name:"rstyro"}) set a.age=168;
# 删除,清库 MATCH (n) DETACH DELETE n ;
# 删除 对象,name 为rstyro的 match (n:Person{name:"rstyro"}) delete n;
|