neo4j 模糊查询有两种方式:
(1)使用 =~’.模糊匹配对象.’ 进行表示
match (a)-[r]->(b)
where rab.relationship=~'.*friend.*'
return a,r,b
limit 10
(2)使用关键字 starts with、 end with、Contains 进行表示
- 查询job 以‘neo4j’开头的节点:
Match (a)
where a.job starts with ‘teacher’
return a
limit 10
- 查询job 以‘neo4j’结尾的节点:
Match (a)
where a.job ends with ‘teacher’
return a
- 查询job 中含有 ‘neo4j’的节点
Match (a)
where a.job Contains ‘teacher’
return a
如有新的方法,欢迎大家提醒补充,谢谢!