Node query through UQL in a graph is very similar to table query in traditional database, by giving some filtering rules, user can acquire and assemble node data or aggregate the results.
Syntax:
- Command:
find()
- Parameter: (see the table below)
- Statement Alias: Custom alias supported (by default it is nodes), structure type is NODE
Parameter | Type | Specification | Description | Structure Type of Custom Alias |
---|---|---|---|---|
nodes() |
Filter | Mandatory | Filtering rules of node | Not supported |
The default custom alias nodes is automatically defined by system when there is no manually defined alias at the end of the node query statement; in this case user cannot use nodes to define custom alias for other data in subsequent UQL statement, error of duplicated name will be triggered otherwise. If there is manually defined alias at the end of the node query statement, it shall prevail.
Unconditional
Example: Find 10 nodes, return all node properties
find().nodes() as n
limit 10
return n{*}
ID
Example: Find nodes whose ID equals CA001, return all node properties
find().nodes({_id == "CA001"})
return nodes{*}
UUID
Example: Find cards 1, 2 and 3, return all node properties
find().nodes([1,2,3]) as n
return n{*}
Schema
Example: Find 10 @card, return all node properties
find().nodes({@card}) as n
limit 10
return n{*}
Property
Example: Find 10 nodes at level 1 and above, return all node properties
find().nodes({level > 1}) as n
limit 10
return n{*}
Schema & Property
Example: Find 10 @card at level 1 and above, return all node properties
find().nodes({@card.level > 1}) as n
limit 10
return n{*}
Default Statement Alias
Example: Find 10 nodes, return all node properties
find().nodes()
limit 10
return nodes{*}