(二)WHERE
//where不单独使用,与match,optional match,start,with搭配
where 与match,optional match 一起用,表示约束
where 与start,with一起用,表示过滤
create(andres:Swedish{name:"Andres",age:36,belt:"white"}),
(peter:Person{name:"Peter",email:"peter_n@example.com",age:34}),
(tobias:Person{name:"Tobias",address:"Sweden/Maimo",age:25}),
(andres)-[:KNOWS{since:1999}]->(peter),
(andres)-[:KNOWS{since:2012}]->(tobias)
1.布尔运算 xor结果不同为true
match(n) where n.name="Peter" XOR
(n.age<30 and n.name="Tobias") OR
NOT(n.name="Tobias" OR n.name="Peter")
return n
2.节点标签过滤
match(n) where n:Swedish return n
3.节点的属性过滤
match(n) where n.age<30 return n
4.关系属性的过滤
match(n)-[k:KNOWS]->(f) where k.since<2000 return f
5.动态节点属性的过滤
//以方括号语法的形式可使用动态计算的值来过滤属性
:param prop:"AGE"
match(n) where n[toLower($prop)]<30 return n
6.属性存在性检查exists
match(n) where exists(n.belt) return n
(二)字符串匹配
//匹配区分大小写
STARTS WITH ,ENDS WITH来匹配字符串的开始或者结尾,如果不关心位置,可以用CONTAINS
1.匹配字符串的开始
match(n) where n.name STARTS WITH "Pet" return n
2.匹配字符串的结尾
match(n) where n.name ENDS WITH "ter" return n
3. 字符串包含
match(n) where n.name CONTAINS "ete" return n
4. 字符串反向匹配
match (n) where NOT n.name STARTS WITH "s" return n
(三)正则表达式
1.正则表达式=~'regexp'
//不区分大小写(?i)多行(?m)单行(?s)
match(n) where n.name=~"(?i)Tob.*" return n
2.正则表达式中的转义字符(包括字符串)
match(n) where n.address=~"Sweden\\/Maimo" return n
(四)在where中使用路径模式
1.模式过滤
//模式返回的是一个路径列表的表达式,列表表达式也是断言,空列表代表false,非空列表代表false
//模式的局限性只能在单条路径中表达,不能像match那样使用逗号分隔多条路径,但可以通过and组合多个模式
match(tobias{name:"Tobias"}),(others)
where others.name in ["Andres","Peter"] AND (tobias)<--(others) return others
2. NOT 过滤
match (persons),(peter{name:"Peter"}) WHERE NOT (persons)-->(peter) return persons
3.模式中的属性过滤
match(n) where (n)-[:KNOWS]-({name:"Tobias"}) return n
4.关系类型的过滤
match(n)-[r]-() where n.name="Andres" AND type(r)=~"K.*" return r
(四)列表 IN
match(a) where a.name in ["Peter","Tobias"] RETURN a
(五)不存在的属性和值
1.属性不存在默认为true
match(n) where n.belt="white" or n.belt is null return n
2.空值过滤
match(person) where person.name="Peter" and person.belt is null return person
(六)属性范围
1.简单范围
match(a) where a.name>="Peter" RETURN a
2.范围组合
match (a) where a.name>"Andres" AND a.name<"Tobias" RETURN a

where_1的更多相关文章

  1. THINKPHP and or 模板语句书写

    select * from xx where (a = 22 or b = 333) or (c=11 and d=22) $where_1['a'] = array('eq', '222'); $w ...

  2. numpy 库使用

    numpy 库简单使用 一.numpy库简介 Python标准库中提供了一个array类型,用于保存数组类型的数据,然而这个类型不支持多维数据,不适合数值运算.作为Python的第三方库numpy便有 ...

  3. numpy 库简单使用

    numpy 库简单使用 一.numpy库简介 Python标准库中提供了一个array类型,用于保存数组类型的数据,然而这个类型不支持多维数据,不适合数值运算.作为Python的第三方库numpy便有 ...

  4. ThinkPHP 中 where条件 or,and 同时使用

    ('a'=1 and 'b'=2) or ('c'=3 and 'd'=4) and 'e'=5 $where_1['a'] = 1; $where_1['b'] = 2; $where_2['c'] ...

随机推荐

  1. 用jQuery实现轮播图效果,js中的排他思想

    ---恢复内容开始--- jQuery实现轮播图不用单独加载. 思路: a. 通过$("#id名");选择需要的一类标签,获得一个伪数组 b.由于是伪数组的原因,而对数组的处理最多 ...

  2. veil-catapult

    veil-catapult进行payload投放,直接使payload在内存中执行. kaliIP:192.168.1.119 目标IP:192.168.1.121 1.powershell powe ...

  3. codeblocks17.12 不能启动调试器

    调试器需要手动指定. settings->debugger->default->executable path.这里默认空的,需要指定.路径在安装目录下的CodeBlocks\Min ...

  4. laravel框架中报错 DataTables warning: table id=xxx-table - Cannot reinitialise DataTable.

    laravel框架中报错 DataTables warning: table id=xxx-table - Cannot reinitialise DataTable. 分析: initializin ...

  5. JMeter监控内存及CPU ——plugin插件监控被测系统资源方法

    jmeter中也可以监控服务器的CPU和内存使用情况,但是需要安装一些插件还需要在被监测服务器上开启服务. 1.需要的插件准备 JMeterPlugins-Standard-1.3.1.zip  下载 ...

  6. synchronized细节问题(一)

    synchronized锁重入: 关键字synchronized拥有锁重入的功能,也就是在使用synchronized时,当一个线程得到一个对象的锁后,再次请求此对象时是可以再次得到该对象的锁. 下面 ...

  7. f5时间设置

    方法一:NTP(推荐) 注:修改ntp server后大约需要10分钟左右才能同步成功. 查看ntp状态: 方法二:手动修改

  8. 项目总结10:通过反射解决springboot环境下从redis取缓存进行转换时出现ClassCastException异常问题

    通过反射解决springboot环境下从redis取缓存进行转换时出现ClassCastException异常问题 关键字 springboot热部署  ClassCastException异常 反射 ...

  9. easyui datagrid 三层嵌套

    代码: function local(role,region,ip){ $("#roleList").datagrid({ // title:'服务器监控列表', height:( ...

  10. Day 04 列表,元祖,range

    列表: why: 1.字符串取值费劲 2.对字符串做任何操作,取出来的都是字符串 3.字符串有长度限制 基于以上原因,python提供了另一个数据类型,list 容器类数据类型. 列表页脚数组,可以存 ...