- Expression:
<value>
NIN<list>
- Left operand: string, number, time, list, point, NODE, EDGE
- Right operand: list
Constant
Example: Judge whether 2 does not belong to [1,2,3]
return 2 nin [1,2,3]
0
Function
Example: Judge whether 2 does not belong to the intersection of [1,2,3] and [3,2,5]
return 2 nin intersection([1,2,3], [3,2,5])
0
Alias
Example: Judge each row of an alias whether it does not belong to [0,1,3]
uncollect [1,2,3,2,2] as a
return a nin [0,1,3]
0
1
0
1
1
Sample graph: (to be used for the following examples)
Run below UQLs one by one in an empty graphset to create graph data: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:"[email protected]"},{_id:"P002",_uuid:2,age:27,email:"[email protected]"}])
insert().into(@student).nodes([{_id:"S001",_uuid:3,age:27,email:"[email protected]"},{_id:"S002",_uuid:4,age:20,email:"[email protected]"},{_id:"S003",_uuid:5,age:25,email:"[email protected]"}])
Property
Example: Find nodes whose age does not belong to [20,25,30,35]
find().nodes({age nin [20,25,30,35]}) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P001 | 1 | 53 | [email protected] |
| P002 | 2 | 27 | [email protected] |
|---------------- @student ---------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| S001 | 3 | 27 | [email protected] |
Example: Find nodes of @professor, whose age does not belong to [20,25,30,35]
find().nodes({@professor.age nin [20,25,30,35]}) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P001 | 1 | 53 | [email protected] |
| P002 | 2 | 27 | [email protected] |