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、节点邻居节点的查找

https://neo4j.com/labs/apoc/4.1/graph-querying/neighborhood/

https://www.cnblogs.com/sea520/p/11940400.html

参考:

 http://www.voidcn.com/article/p-hflcgpop-bvw.html

https://blog.csdn.net/liliang199/article/details/87255019

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值