The autonet().src().dest().depth() query can find and return paths from a group of initial-nodes to a group of terminal-nodes. It is a batch processing of A-B path query by paring an initial-node and a terminal-node for each query, and its parameter limit() is limiting the number of returns of each A-B pair of each subquery, but not that of all A-B pairs of each subquery.
Determined by the usage of parameter dest(), autonet query works in two modes:
a) Inter-group Networking (when setting dest())
N nodes from one group pairing with M nodes from another groupN * M times of A-B path querylimit(n) is carried and the value of n is not -1, maximum n * N * M paths will be foundb) Intra-group Networking (when omitting dest())
N(N-1)/2 times of A-B path querylimit(n) is carried and the value of n is not -1, maximum n * N(N-1)/2 paths will be found
Syntax:
| Parameter | Type | Specification | Description | Structure of Custom Alias |
|---|---|---|---|---|
src() | Filter | Mandatory | The filtering rules of the start node | NODE |
dest() | Filter | The filtering rules of the end node | NODE | |
depth() | Range | Mandatory | To set the depth of the path depth(N): N edges depth(:N): 1~N edges depth(M:N): M~N edges depth(N).shortest(): the shortest path within N edges | Not supported |
shortest() | / or @<schema>.<property> | LTE-ed numeric edge property | Return the (weighted) shortest path. When an edge property (with non-negative values) is specified, edges without that property will not be considered The shortest() method only supports depth(N), indicating the (weighted) shortest paths within N steps | Not supported |
node_filter() | Filter | The filtering rules that nodes other than src and dest need to satisfy | Not supported | |
edge_filter() | Filter | The filtering rules that all edges need to satisfy | Not supported | |
direction() | String | left, right | To specify the direction of the edge | Not supported |
no_circle() | / | / | To dismiss the paths with circles; see Basic Concept - Terminologies for the definition of circle | Not supported |
limit() | Int | -1 or >=0 | Number of results of each A-B pair to return, -1 means to return all results | Not supported |
Sample graph: (to be used for the following examples)

Example: Find 1~3-step paths from [A,B] to [D,E], carry all properties
UQLautonet().src({_id in ["A","B"]}).dest({_id in ["D","E"]}).depth(:3) as p return p{*}
ResultA --3--> E --5--> D A --1--> C <--4-- D A <--6-- B <--2-- E --5--> D A --3--> E A --1--> C <--4-- D <--5-- E A <--6-- B <--2-- E B --6--> A --3--> E --5--> D B --6--> A --1--> C <--4-- D B <--2-- E --5--> D B --6--> A --3--> E B <--2-- E
Example: Find shortest paths from [A,B] to [D,E] within 3 steps, carry all properties
UQLautonet().src({_id in ["A","B"]}).dest({_id in ["D","E"]}).depth(3) .shortest() as p return p{*}
ResultA --1--> C <--4-- D A --3--> E --5--> D A --3--> E B <--2-- E --5--> D B <--2-- E
Example: Find 1~3-step paths from [A,B] to [D,E], return 1 path for each pair of nodes, carry all properties
UQLautonet().src({_id in ["A","B"]}).dest({_id in ["D","E"]}).depth(:3).limit(1) as p return p{*}
ResultA <--6-- B <--2-- E --5--> D A <--6-- B <--2-- E B <--2-- E --5--> D B <--2-- E
Example: Find 1~3-step paths among [A,B,C], carry all properties
UQLautonet().src({_id in ["A","B","C"]}).depth(:3) as p return p{*}
ResultA --3--> E --2--> B A <--6-- B A --3--> E --5--> D --4--> C A --1--> C B --6--> A --1--> C B <--2-- E --5--> D --4--> C B <--2-- E <--3-- A --1--> C
Example: Find shortest paths among [A,B,C] within 3 steps, carry all properties
UQLautonet().src({_id in ["A","B","C"]}).depth(3) .shortest() as p return p{*}
ResultA <--6-- B A --1--> C B --6--> A --1--> C
Example: Find 1~3-step paths among [A,B,C], return 1 path for each pair of nodes, carry all properties
UQLautonet().src({_id in ["A","B","C"]}).depth(:3).limit(1) as p return p{*}
ResultA <--6-- B A --1--> C B <--2-- E <--3-- A --1--> C