TraversalOptions extends QueryOptions
Table of Contents
Constants
- CACHE_ENABLED : string = 'cacheEnabled'
- DEDUPLICATE : string = 'deduplicate'
- DISABLE_INDEX : string = 'disableIndex'
- ESTIMATES : string = 'estimates'
- EXCLUSIVE : string = 'exclusive'
- EXPIRE_AFTER : string = 'expireAfter'
- FIELD_VALUE_TYPES : string = 'fieldValueTypes'
- FIELDS : string = 'fields'
- FORCE_INDEX_HINT : string = 'forceIndexHint'
- GEO_JSON : string = 'geoJson'
- IGNORE_ERRORS : string = 'ignoreErrors'
- IGNORE_REVS : string = 'ignoreRevs'
- IN_BACKGROUND : string = 'inBackground'
- INDEX_HINT : string = 'indexHint'
- KEEP_NULL : string = 'keepNull'
- LEGACY_POLYGONS : string = 'legacyPolygons'
- LOOKAHEAD : string = 'lookahead'
- MAX_PROJECTIONS : string = 'maxProjections'
- MERGE_OBJECTS : string = 'mergeObjects'
- METHOD : string = 'method'
- NAME : string = 'name'
- OVERWRITE_MODE : string = 'overwriteMode'
- PARALLELISM : string = 'parallelism'
- PARAMS : string = 'params'
- PREFIX_FIELDS : string = 'prefixFields'
- READ_OWN_WRITES : string = 'readOwnWrites'
- REFILL_INDEX_CACHES : string = 'refillIndexCaches'
- SPARSE : string = 'sparse'
- STORED_VALUE : string = 'storedValue'
- TYPE : string = 'type'
- UNIQUE : string = 'unique'
- USE_CACHE : string = 'useCache'
- WAIT_FOR_SYNC : string = 'waitForSync'
Properties
- $defaultWeight : int|null
- Specifies the default weight of an edge (number). The default value is 1.
- $edgeCollections : string|array<string|int, mixed>|null
- Restrict edge collections the traversal may visit (string|array).
- $indexHint : object|null
- You can provide index hints for traversals to let the optimizer prefer the vertex-centric indexes you specify over the regular edge index.
- $maxProjections : int|null
- Specifies the number of document attributes per FOR loop to be used as projections (number).
- $order : string|null
- Specify which traversal algorithm to use (string): - "bfs" – the traversal is executed breadth-first.
- $parallelism : int|null
- Parallelize traversal execution (number).
- $uniqueEdges : string|null
- Ensure edge uniqueness (string):
- $uniqueVertices : string|null
- Ensure node uniqueness (string):
- $useCache : bool|null
- Whether to use the in-memory cache for edges. The default is true.
- $vertexCollections : null|string|array<string|int, mixed>
- Restrict node collections the traversal may visit (string|array).
- $weightAttribute : string|null
- Specifies the name of an attribute that is used to look up the weight of an edge (string).
Methods
- __construct() : mixed
- Creates a new QueryOptions instance.
- jsonSerialize() : array<string|int, mixed>
- Invoked to serialize the object with the json serializer.
Constants
CACHE_ENABLED
public
string
CACHE_ENABLED
= 'cacheEnabled'
DEDUPLICATE
public
string
DEDUPLICATE
= 'deduplicate'
DISABLE_INDEX
public
string
DISABLE_INDEX
= 'disableIndex'
ESTIMATES
public
string
ESTIMATES
= 'estimates'
EXCLUSIVE
public
string
EXCLUSIVE
= 'exclusive'
EXPIRE_AFTER
public
string
EXPIRE_AFTER
= 'expireAfter'
FIELD_VALUE_TYPES
public
string
FIELD_VALUE_TYPES
= 'fieldValueTypes'
FIELDS
public
string
FIELDS
= 'fields'
FORCE_INDEX_HINT
public
string
FORCE_INDEX_HINT
= 'forceIndexHint'
GEO_JSON
public
string
GEO_JSON
= 'geoJson'
IGNORE_ERRORS
public
string
IGNORE_ERRORS
= 'ignoreErrors'
IGNORE_REVS
public
string
IGNORE_REVS
= 'ignoreRevs'
IN_BACKGROUND
public
string
IN_BACKGROUND
= 'inBackground'
INDEX_HINT
public
string
INDEX_HINT
= 'indexHint'
KEEP_NULL
public
string
KEEP_NULL
= 'keepNull'
LEGACY_POLYGONS
public
string
LEGACY_POLYGONS
= 'legacyPolygons'
LOOKAHEAD
public
string
LOOKAHEAD
= 'lookahead'
MAX_PROJECTIONS
public
string
MAX_PROJECTIONS
= 'maxProjections'
MERGE_OBJECTS
public
string
MERGE_OBJECTS
= 'mergeObjects'
METHOD
public
string
METHOD
= 'method'
NAME
public
string
NAME
= 'name'
OVERWRITE_MODE
public
string
OVERWRITE_MODE
= 'overwriteMode'
PARALLELISM
public
string
PARALLELISM
= 'parallelism'
PARAMS
public
string
PARAMS
= 'params'
PREFIX_FIELDS
public
string
PREFIX_FIELDS
= 'prefixFields'
READ_OWN_WRITES
public
string
READ_OWN_WRITES
= 'readOwnWrites'
REFILL_INDEX_CACHES
public
string
REFILL_INDEX_CACHES
= 'refillIndexCaches'
SPARSE
public
string
SPARSE
= 'sparse'
STORED_VALUE
public
string
STORED_VALUE
= 'storedValue'
TYPE
public
string
TYPE
= 'type'
UNIQUE
public
string
UNIQUE
= 'unique'
USE_CACHE
public
string
USE_CACHE
= 'useCache'
WAIT_FOR_SYNC
public
string
WAIT_FOR_SYNC
= 'waitForSync'
Properties
$defaultWeight
Specifies the default weight of an edge (number). The default value is 1.
public
int|null
$defaultWeight
The value must not be negative.
Tags
$edgeCollections
Restrict edge collections the traversal may visit (string|array).
public
string|array<string|int, mixed>|null
$edgeCollections
If omitted or an empty array is specified, then there are no restrictions.
A string parameter is treated as the equivalent of an array with a single element. Each element of the array should be a string containing the name of an edge collection.
Tags
$indexHint
You can provide index hints for traversals to let the optimizer prefer the vertex-centric indexes you specify over the regular edge index.
public
object|null
$indexHint
This is useful for cases where the selectively estimate of the edge index is higher than the ones for suitable vertex-centric indexes (and thus they aren’t picked automatically) but the vertex-centric indexes are known to perform better.
The indexHint option expects an object in the following format:
{ "<edgeColl>": { "
<edgeColl>: The name of an edge collection for which the index hint shall be applied. Collection names are case-sensitive.
Tags
$maxProjections
Specifies the number of document attributes per FOR loop to be used as projections (number).
public
int|null
$maxProjections
The default value is 5.
The AQL optimizer automatically detects which document attributes you access in traversal queries and optimizes the data loading.
This optimization is beneficial if you have large documents but only access a few document attributes. The maxProjections option lets you tune when to load individual attributes versus the whole document.
Tags
$order
Specify which traversal algorithm to use (string): - "bfs" – the traversal is executed breadth-first.
public
string|null
$order
The results first contain all vertices at depth 1, then all vertices at depth 2 and so on.
- "dfs" (default) – the traversal is executed depth-first. It first returns all paths from min depth to max depth for one vertex at depth 1, then for the next vertex at depth 1 and so on. "weighted" - the traversal is a weighted traversal (introduced in v3.8.0). Paths are enumerated with increasing cost. Also see weightAttribute and defaultWeight. A returned path has an additional attribute weight containing the cost of the path after every step. The order of paths having the same cost is non-deterministic. Negative weights are not supported and abort the query with an error.
Tags
$parallelism
Parallelize traversal execution (number).
public
int|null
$parallelism
If omitted or set to a value of 1, the traversal execution is not parallelized. If set to a value greater than 1, then up to that many worker threads can be used for concurrently executing the traversal.
The value is capped by the number of available cores on the target machine.
Parallelizing a traversal is normally useful when there are many inputs (start nodes) that the nested traversal can work on concurrently. This is often the case when a nested traversal is fed with several tens of thousands of start nodes, which can then be distributed randomly to worker threads for parallel execution.
Tags
$uniqueEdges
Ensure edge uniqueness (string):
public
string|null
$uniqueEdges
- "path" (default) – it is guaranteed that there is no path returned with a duplicate edge
- "none" – no uniqueness check is applied on edges. Note: Using this configuration, the traversal follows edges in cycles.
Tags
$uniqueVertices
Ensure node uniqueness (string):
public
string|null
$uniqueVertices
- "path" – it is guaranteed that there is no path returned with a duplicate vertex
- "global" – it is guaranteed that each vertex is visited at most once during the traversal, no matter how many paths lead from the start vertex to this one. If you start with a min depth > 1 a vertex that was found before min depth might not be returned at all (it still might be part of a path). It is required to set order: "bfs" or order: "weighted" because with depth-first search the results would be unpredictable. Note: Using this configuration the result is not deterministic any more. If there are multiple paths from startVertex to vertex, one of those is picked. In case of a weighted traversal, the path with the lowest weight is picked, but in case of equal weights it is undefined which one is chosen.
- "none" (default) – no uniqueness check is applied on vertices
Tags
$useCache
Whether to use the in-memory cache for edges. The default is true.
public
bool|null
$useCache
You can set this option to false to not make a large graph operation pollute the edge cache.
Tags
$vertexCollections
Restrict node collections the traversal may visit (string|array).
public
null|string|array<string|int, mixed>
$vertexCollections
If omitted or an empty array is specified, then there are no restrictions.
A string parameter is treated as the equivalent of an array with a single element. Each element of the array should be a string containing the name of a node collection. The starting node is always allowed, even if it does not belong to one of the collections specified by a restriction.
Tags
$weightAttribute
Specifies the name of an attribute that is used to look up the weight of an edge (string).
public
string|null
$weightAttribute
If no attribute is specified or if it is not present in the edge document then the defaultWeight is used.
The attribute value must not be negative.
Tags
Methods
__construct()
Creates a new QueryOptions instance.
public
__construct([array<string|int, mixed>|object|null $init = null ]) : mixed
Parameters
- $init : array<string|int, mixed>|object|null = null
-
A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.
jsonSerialize()
Invoked to serialize the object with the json serializer.
public
jsonSerialize() : array<string|int, mixed>