Represents a View in a Database.

Hierarchy

  • View

Accessors

  • get name(): string
  • Name of the View.

    Returns string

Methods

  • Deletes the View from the database.

    Example

    const db = new Database();
    const view = db.view("some-view");
    await view.drop();
    // the View "some-view" no longer exists

    Returns Promise<boolean>

  • Checks whether the View exists.

    Example

    const db = new Database();
    const view = db.view("some-view");
    const exists = await view.exists();
    console.log(exists); // indicates whether the View exists

    Returns Promise<boolean>

  • Renames the View and updates the instance's name to newName.

    Additionally removes the instance from the Database's internal cache.

    Note: Renaming Views may not be supported when ArangoDB is running in a cluster configuration.

    Example

    const db = new Database();
    const view1 = db.view("some-view");
    await view1.rename("other-view");
    const view2 = db.view("some-view");
    const view3 = db.view("other-view");
    // Note all three View instances are different objects but
    // view1 and view3 represent the same ArangoDB view!

    Parameters

    • newName: string

      The new name of the View.

    Returns Promise<ArangoApiResponse<ViewDescription>>

Generated using TypeDoc