@
judges whether the current node/edge belongs to a given schema, and is often combined with property filtering.
- Expression: @
<schema>
- Operand: string constant
When combined with property filtering, i.e.,
@<schema> && <property> == 123
is shortened as@<schema>.<property> == 123
, the<property>
cannot be _id or _uuid
The
@<schema>
and@<schema>.<property>
that appear in an Ultipa filter find the metadata of a specific schema and/or property, which is different than the@<schema>
and@<schema>.<property>
that appear in some other chain statements that find a specific schema and/or property in a graph model. Please read GraphSet | Schema | Property for more information.
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 edges 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 &&
.