表达式
<exp1>
xor <exp2>
- 操作数:表达式
- 两个子表达式真假不同时,异或表达式为真(1),否则为假(0):
<exp1>结果 | <exp2>结果 | 异或表达式结果 |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
示例
示例图集

在一个空图集中,依次运行以下各行语句创建示例图集:
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"}])
一般用法
本例查找schema为@professor或email属性值以com结尾的点,但排除两个要求都满足的点:
find().nodes({@professor xor endsWith(email, "com")}) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P001 | 1 | 53 | test@yahoo.cn |
|---------------- @student ---------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| S003 | 5 | 25 | test@gmail.com |