表达式
<value1>
== <value2>
- 操作数:数字、时间、字符串
示例
判断常量
本例判断Ultipa是否等于U1tipa:
return "Ultipa" == "U1tipa"
0
判断函数值
本例判断函数pi()
的结果是否等于3:
return pi() == 3
0
判断别名
本例判断一个别名的每行是否等于2:
uncollect [1,2,3,2,2] as a
return a == 2
0
1
0
1
1
过滤属性值
示例图集:

在一个空图集中,依次运行以下各行语句创建示例图集:
create().node_schema("professor").node_schema("student")
create().node_property(@*, "age", int32).node_property(@*, "email", string)
insert().into(@professor).nodes([{_id:"P001",_uuid:1,age:53,email:"test@yahoo.cn"},{_id:"P002",_uuid:2,age:27,email:"test@ultipa.com"}])
insert().into(@student).nodes([{_id:"S001",_uuid:3,age:27,email:"test@yeah.net"},{_id:"S002",_uuid:4,age:20,email:"test@w3.org"},{_id:"S003",_uuid:5,age:25,email:"test@gmail.com"}])
本例查询age属性值为27的点:
find().nodes({age == 27}) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P002 | 2 | 27 | test@ultipa.com |
|---------------- @student ---------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| S001 | 3 | 27 | test@yeah.net |
本例查询age属性值为27的@professor点:
find().nodes({@professor.age == 27}) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P002 | 2 | 27 | test@ultipa.com |
过滤_uuid(简写形式)
当过滤器只判断点或边的_uuid
是否等于一个整数时,该过滤器可简写为:
标准形式 | 简写形式 | 说明 |
---|---|---|
({ _uuid == 10}) | (10) | |
({ _uuid == int }) |
(int ) |
int 为整数的别名 |
({ _uuid == node ._uuid}) |
(node ) |
node 为NODE类型的别名 |
({ _uuid == edge ._uuid}) |
(edge ) |
edge 为EDGE类型的别名 |
本例查询_uuid
为1的点:
find().nodes(1) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P001 | 1 | 53 | test@yahoo.cn |