Function arangojs

  • Creates a new Database instance with its own connection pool.

    This is a wrapper function for the database.Database:constructor.

    Parameters

    • Optional config: Config

      An object with configuration options.

    Returns Database

    Example

    const db = arangojs({
    url: "http://127.0.0.1:8529",
    databaseName: "myDatabase",
    auth: { username: "admin", password: "hunter2" },
    });
  • Creates a new Database instance with its own connection pool.

    This is a wrapper function for the database.Database:constructor.

    Parameters

    • url: string | string[]

      Base URL of the ArangoDB server or list of server URLs. Equivalent to the url option in connection.Config.

    • Optional name: string

    Returns Database

    Example

    const db = arangojs("http://127.0.0.1:8529", "myDatabase");
    db.useBasicAuth("admin", "hunter2");