The clause find().edges() retrieves edges from the graphset that meet specified conditions.
Clause alias: EDGE type; default alias is edges
Method | Param Type | Param Spec | Required | Description | Alias |
|---|---|---|---|---|---|
edges() | Filter | / | Yes | The conditions of edges to be retrieved | N/A |
limit() | Integer | ≥-1 | No | Number of results to return for each subquery, -1 signifies returning all | N/A |

Run these UQLs row by row in an empty graphset to create this graph:
UQLcreate().node_schema("professor").node_schema("student").edge_schema("mentor").edge_schema("assist") create().node_property(@*, "age", int32).node_property(@*, "email", string).edge_property(@*, "year", int32)Click to expand
UQLfind().edges() as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 1 | P002 | S001 | 2 | 3 | mentor | 2020 |
| 2 | P001 | S001 | 1 | 3 | mentor | 2021 |
| 3 | P001 | S002 | 1 | 4 | mentor | 2021 |
| 4 | P001 | S003 | 1 | 5 | mentor | 2022 |
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 5 | S001 | P002 | 3 | 2 | assist | 2020 |
| 6 | S002 | P001 | 4 | 1 | assist | 2022 |
UQLfind().edges(1) as e return e{*}
NOTEThe filter
{_uuid == 1}can be simplified to1.
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 1 | P002 | S001 | 2 | 3 | mentor | 2020 |
UQLfind().edges([1,3]) as e return e{*}
NOTEThe filter
{_uuid in [1,3]}can be simplified to[1,3].
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 1 | P002 | S001 | 2 | 3 | mentor | 2020 |
| 3 | P001 | S002 | 1 | 4 | mentor | 2021 |
UQLfind().edges({_from == "P001"}) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 2 | P001 | S001 | 1 | 3 | mentor | 2021 |
| 3 | P001 | S002 | 1 | 4 | mentor | 2021 |
| 4 | P001 | S003 | 1 | 5 | mentor | 2022 |
UQLfind().edges({_to == "P001"}) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 6 | S002 | P001 | 4 | 1 | assist | 2022 |
UQLfind().edges({@assist}) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 5 | S001 | P002 | 3 | 2 | assist | 2020 |
| 6 | S002 | P001 | 4 | 1 | assist | 2022 |
UQLfind().edges({@assist || @mentor}) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 1 | P002 | S001 | 2 | 3 | mentor | 2020 |
| 2 | P001 | S001 | 1 | 3 | mentor | 2021 |
| 3 | P001 | S002 | 1 | 4 | mentor | 2021 |
| 4 | P001 | S003 | 1 | 5 | mentor | 2022 |
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 5 | S001 | P002 | 3 | 2 | assist | 2020 |
| 6 | S002 | P001 | 4 | 1 | assist | 2022 |
UQLfind().edges({year == 2020}) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 1 | P002 | S001 | 2 | 3 | mentor | 2020 |
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 5 | S001 | P002 | 3 | 2 | assist | 2020 |
UQLfind().edges({@assist.year == 2020}) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 5 | S001 | P002 | 3 | 2 | assist | 2020 |
UQLfind().edges().limit(3) return edges{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 1 | P002 | S001 | 2 | 3 | mentor | 2020 |
| 2 | P001 | S001 | 1 | 3 | mentor | 2021 |
| 3 | P001 | S002 | 1 | 4 | mentor | 2021 |
UQLfind().edges().limit(3) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 1 | P002 | S001 | 2 | 3 | mentor | 2020 |
| 2 | P001 | S001 | 1 | 3 | mentor | 2021 |
| 3 | P001 | S002 | 1 | 4 | mentor | 2021 |
UQLuncollect [2022, 2023, 2024] as value optional find().edges({year == value}) as e return e{*}
Result:
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 4 | P001 | S003 | 1 | 5 | mentor | 2022 |
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema | year |
|---|---|---|---|---|---|---|
| 6 | S002 | P001 | 4 | 1 | assist | 2022 |
| _uuid | _from | _to | _from_uuid | _to_uuid | Schema |
|---|---|---|---|---|---|
| null | null | null | null | null | null |
| null | null | null | null | null | null |
If the prefix OPTIONAL is not used, null results will not be returned.