Type alias TraversalOptions

TraversalOptions: {
    direction?: "inbound" | "outbound" | "any";
    expander?: string;
    filter?: string;
    init?: string;
    itemOrder?: "forward" | "backward";
    maxDepth?: number;
    maxIterations?: number;
    minDepth?: number;
    order?: "preorder" | "postorder" | "preorder-expander";
    sort?: string;
    strategy?: "depthfirst" | "breadthfirst";
    uniqueness?: {
        edges?: "none" | "global" | "path";
        vertices?: "none" | "global" | "path";
    };
    visitor?: string;
}

Options for performing a graph traversal.

Deprecated

Simple Queries have been deprecated in ArangoDB 3.4 and are no longer supported in ArangoDB 3.12. They can be replaced with AQL queries.

Type declaration

  • Optional direction?: "inbound" | "outbound" | "any"

    Direction of the traversal, relative to the starting vertex if expander is not set.

  • Optional expander?: string

    A string evaluating to the body of a JavaScript function to be executed on the server to use when direction is not set.

    The code has access to three variables: config, vertex, path. The code must return an array of objects with edge and vertex attributes representing the connections for the vertex.

    Note: This code will be evaluated and executed on the server inside ArangoDB's embedded JavaScript environment and can not access any other variables.

    See the official ArangoDB documentation for the JavaScript @arangodb module for information about accessing the database from within ArangoDB's server-side JavaScript environment.

  • Optional filter?: string

    A string evaluating to the body of a JavaScript function to be executed on the server to filter nodes.

    The code has access to three variables: config, vertex, path. The code may include a return statement for the following values:

    • "exclude": The vertex will not be visited.
    • "prune": The edges of the vertex will not be followed.
    • "" or undefined: The vertex will be visited and its edges followed.
    • an array including any of the above values.

    Note: This code will be evaluated and executed on the server inside ArangoDB's embedded JavaScript environment and can not access any other variables.

    See the official ArangoDB documentation for the JavaScript @arangodb module for information about accessing the database from within ArangoDB's server-side JavaScript environment.

  • Optional init?: string

    A string evaluating to the body of a JavaScript function to be executed on the server to initialize the traversal result object.

    The code has access to two variables: config, result. The code may modify the result object.

    Note: This code will be evaluated and executed on the server inside ArangoDB's embedded JavaScript environment and can not access any other variables.

    See the official ArangoDB documentation for the JavaScript @arangodb module for information about accessing the database from within ArangoDB's server-side JavaScript environment.

  • Optional itemOrder?: "forward" | "backward"

    Item iteration order.

  • Optional maxDepth?: number

    If specified, only nodes in at most this depth will be visited.

  • Optional maxIterations?: number

    Maximum number of iterations before a traversal is aborted because of a potential endless loop.

  • Optional minDepth?: number

    If specified, only nodes in at least this depth will be visited.

  • Optional order?: "preorder" | "postorder" | "preorder-expander"

    Traversal order.

  • Optional sort?: string

    A string evaluating to the body of a JavaScript function to be executed on the server to sort edges if expander is not set.

    The code has access to two variables representing edges: l, r. The code must return -1 if l < r, 1 if l > r or 0 if both values are equal.

    Note: This code will be evaluated and executed on the server inside ArangoDB's embedded JavaScript environment and can not access any other variables.

    See the official ArangoDB documentation for the JavaScript @arangodb module for information about accessing the database from within ArangoDB's server-side JavaScript environment.

  • Optional strategy?: "depthfirst" | "breadthfirst"

    Traversal strategy.

  • Optional uniqueness?: {
        edges?: "none" | "global" | "path";
        vertices?: "none" | "global" | "path";
    }

    Specifies uniqueness for vertices and edges.

    • Optional edges?: "none" | "global" | "path"

      Uniqueness for edges.

    • Optional vertices?: "none" | "global" | "path"

      Uniqueness for vertices.

  • Optional visitor?: string

    A string evaluating to the body of a JavaScript function to be executed on the server when a node is visited.

    The code has access to five variables: config, result, vertex, path, connected. The code may modify the result object.

    Note: This code will be evaluated and executed on the server inside ArangoDB's embedded JavaScript environment and can not access any other variables.

    See the official ArangoDB documentation for the JavaScript @arangodb module for information about accessing the database from within ArangoDB's server-side JavaScript environment.

Generated using TypeDoc