Expression, Operand
in
judges if a given value belongs to a set.
Syntax:
- Expression:
<value>
in<array>
- Operand: see list below
Name | Type | Specification | Description |
---|---|---|---|
value | ATTR(string, number, time) | / | The value to be judged |
array | ARRAY | / | Targeted set |
Abbreviated form: when judging whether the UUID of the current node/edge belongs to an array of integers or an array of UUIDs of a node/edge array alias, the filter can be abbreviated as the array of integers or the node/edge array alias without the curly bracket
Standard Form | Abbreviated Form | Specification |
---|---|---|
({ _uuid in [1,2,3]}) | ([1,2,3]) | |
({ _uuid in intArray }) |
(intArray ) |
intArray is the alias of the set |
Constant
Example: judge if 2 belongs to [1,2,3]
return 2 in [1,2,3]
Function
Example: judge if 2 belongs to [1,2,3]
uncollect [1,2,3] as n
return 2 in collect(n)
Alias
Example: find 10 nodes whose levels belong to [1,2,3]
find().nodes() as n
where n.level in [1, 2, 3]
limit 10
return n{*}
Property
Example: find 10 cards or customers
find().nodes({@ in ["card","customer"]}) as n
limit 10
return n{*}
Example: find 10 nodes whose levels belong to [1,2,3]
find().nodes({level in [1, 2, 3]}) as n
limit 10
return n{*}
UUID (Abbreviated)
Example: find 1-hop neighbors of Node 1 (UUID is 1, etc), Node 2, and Node 3, then find 1-hop neighbors of these neighbors, return deduplicated results
khop().n([1,2,3]).e().n() as n1
with collect(n1) as n2
khop().n(n2).e().n() as n3
return distinct(n3)