Schema filter judges whether the current node/edge belongs to a given schema. Schema filter is often overlaid with property call.
Syntax:
- Expression: @
<schema>
- Operand: string
Schema can only be used in filter, and it cannot be used as experssion alone in an UQL sentence.
Node
Example: find and return 10 Cards with their properties
find().nodes({@card}) as n
limit 10
return n{*}
Analysis: we can also use another expression {@ == "card"}
, see Conditional Operators ==
.
Edge
Example: find and return 10 @transfer egdes with their properties
find().edges({@transfer}) as e
limit 10
return e{*}
Schema & Property
Example: find Cards whose balance is over 500000, return 10 cards with all properties.
find().nodes({@card.balance > 500000}) as n
limit 10
return n{*}
Analysis: this filter can be extended as {@card && balance > 500000}
, see Conditional Operators &&
.