Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Graph

TODO

Hierarchy

  • Graph

Index

Accessors

name

  • get name(): string
  • TODO

    Returns string

Methods

addEdgeDefinition

addVertexCollection

create

drop

  • drop(dropCollections?: boolean): Promise<boolean>
  • TODO

    Parameters

    • Default value dropCollections: boolean = false

    Returns Promise<boolean>

edgeCollection

  • TODO

    Type parameters

    • T: object

    Parameters

    • collectionName: string

    Returns GraphEdgeCollection<T>

edgeCollections

exists

  • exists(): Promise<boolean>
  • TODO

    Returns Promise<boolean>

get

listEdgeCollections

  • listEdgeCollections(): Promise<string[]>
  • TODO

    Returns Promise<string[]>

listVertexCollections

  • listVertexCollections(): Promise<string[]>
  • TODO

    Returns Promise<string[]>

removeEdgeDefinition

  • removeEdgeDefinition(edgeCollection: string, dropCollection?: boolean): Promise<GraphInfo>
  • TODO

    Parameters

    • edgeCollection: string
    • Default value dropCollection: boolean = false

    Returns Promise<GraphInfo>

removeVertexCollection

  • TODO

    Parameters

    • collection: string | ArangoCollection
    • Default value dropCollection: boolean = false

    Returns Promise<GraphInfo>

replaceEdgeDefinition

traversal

  • Performs a traversal starting from the given startVertex and following edges contained in this graph.

    See also EdgeCollection.traversal.

    deprecated

    Simple Queries have been deprecated in ArangoDB 3.4 and can be replaced with AQL queries.

    example
    const db = new Database();
    const graph = db.graph("my-graph");
    const collection = graph.edgeCollection("edges").collection;
    await collection.import([
      ["_key", "_from", "_to"],
      ["x", "vertices/a", "vertices/b"],
      ["y", "vertices/b", "vertices/c"],
      ["z", "vertices/c", "vertices/d"],
    ]);
    const result = await graph.traversal("vertices/a", {
      direction: "outbound",
      init: "result.vertices = [];",
      visitor: "result.vertices.push(vertex._key);",
    });
    console.log(result.vertices); // ["a", "b", "c", "d"]

    Parameters

    • startVertex: string

      Document _id of a vertex in this graph.

    • Optional options: TraversalOptions

      Options for performing the traversal.

    Returns Promise<any>

vertexCollection

vertexCollections

Generated using TypeDoc