neo4j数组属性(属性值有多个)
1、多个属性值的设置语句
match (m:公司{名称:["test3","test2"]}) return m
2、多个属性的查询以及merge的使⽤
OPTIONAL MATCH (n:公司) where "test3" in n.名称
皮草品牌
WITH n
where n is null merge (m:公司{名称:["test3","test2"]})
小学语文板书设计
return m
(1)判断属性是否存在:直接⽤ "属性值 in 节点.属性名"的形式
(2)merge和where不可以同时使⽤,所以,先通过match判断,再通过merge的⽅式创建
参考⽤法:
OPTIONAL MATCH (existing:TYPE) WHERE existing.propertyA = 'A' OR existing.propertyB = 'B' OR existing.propertyC = 'C' WITH existing
谈和平
孔融让梨的故事告诉我们什么道理WHERE existing IS NOT NULL SET existing.propertyA = 'A', existing.propertyB = 'B', existing.propertyC = 'C'
RETURN existing;对自己生日祝福语
OPTIONAL MATCH (existing:TYPE) WHERE existing.propertyA = 'ZZ' OR existing.propertyB = 'ZZ' OR existing.propertyC = 'ZZ' WITH existing
山海关大战WHERE existing IS NULL MERGE (newNode:TYPE {propertyA: 'ZZ', propertyB: 'ZZ', propertyC: 'ZZ'})
RETURN newNode
3、模糊查询
什么是心理活动>个人传记match(emp) where emp.name =~'.*haha.*' return emp
4、其他⽤法
MATCH (n:Test) RETURN distinct keys(n)
5、节点邻居节点的查找
参考: