Options
All
  • Public
  • Public/Protected
  • All
Menu

Module database

import { Database } from "arangojs/database";

The "database" module provides the Database class and associated types and interfaces for TypeScript.

The Database class is also re-exported by the "index" module.

Index

Type aliases

AccessLevel

AccessLevel: "rw" | "ro" | "none"

Access level for an ArangoDB user's access to a collection or database.

AqlUserFunction

AqlUserFunction: { code: string; isDeterministic: boolean; name: string }

Definition of an AQL User Function.

Type declaration

  • code: string

    Implementation of the AQL User Function.

  • isDeterministic: boolean

    Whether the function is deterministic.

    See Database.createFunction.

  • name: string

    Name of the AQL User Function.

ArangoUser

ArangoUser: { active: boolean; extra: Record<string, any>; user: string }

Properties of an ArangoDB user object.

Type declaration

  • active: boolean

    Whether the ArangoDB user account is enabled and can authenticate.

  • extra: Record<string, any>

    Additional information to store about this user.

  • user: string

    ArangoDB username of the user.

AstNode

AstNode: { subNodes: AstNode[]; type: string }

Node in an AQL abstract syntax tree (AST).

Type declaration

  • [key: string]: any
  • subNodes: AstNode[]
  • type: string

CreateDatabaseOptions

CreateDatabaseOptions: { minReplicationFactor?: number; replicationFactor?: "satellite" | number; sharding?: "" | "flexible" | "single"; users?: CreateDatabaseUser[]; writeConcern?: number }

Options for creating a database.

See Database.createDatabase.

Type declaration

  • Optional minReplicationFactor?: number

    (Cluster only.) Default write concern for new collections created in this database.

    deprecated

    Renamed to writeConcern in ArangoDB 3.6.

  • Optional replicationFactor?: "satellite" | number

    (Cluster only.) Default replication factor for new collections in this database.

    Setting this to 1 disables replication. Setting this to "satellite" will replicate to every DBServer.

  • Optional sharding?: "" | "flexible" | "single"

    (Cluster only.) The sharding method to use for new collections in the database.

  • Optional users?: CreateDatabaseUser[]

    Database users to create with the database.

  • Optional writeConcern?: number

    (Cluster only.) Default write concern for new collections created in this database.

CreateDatabaseUser

CreateDatabaseUser: { active?: boolean; extra?: Dict<any>; passwd?: string; username: string }

Database user to create with a database.

Type declaration

  • Optional active?: boolean

    Whether the user is active.

    Default: true

  • Optional extra?: Dict<any>

    Additional data to store with the user object.

  • Optional passwd?: string

    Password of the user to create.

    Default: ""

  • username: string

    Username of the user to create.

CreateUserOptions

CreateUserOptions: { active?: boolean; extra?: Record<string, any>; passwd: string; user: string }

Options for creating an ArangoDB user.

Type declaration

  • Optional active?: boolean

    Whether the ArangoDB user account is enabled and can authenticate.

    Default: true

  • Optional extra?: Record<string, any>

    Additional information to store about this user.

    Default: {}

  • passwd: string

    Password the ArangoDB user will use for authentication.

  • user: string

    ArangoDB username of the user.

DatabaseInfo

DatabaseInfo: { id: string; isSystem: boolean; minReplicationFactor?: number; name: string; path: string; replicationFactor?: "satellite" | number; sharding?: "" | "flexible" | "single"; writeConcern?: number }

Object describing a database.

See Database.get.

Type declaration

  • id: string

    Unique identifier of the database.

  • isSystem: boolean

    Whether the database is the system database.

  • Optional minReplicationFactor?: number

    (Cluster only.) Default write concern for new collections created in this database.

    deprecated

    Renamed to writeConcern in ArangoDB 3.6.

  • name: string

    Name of the database.

  • path: string

    File system path of the database.

  • Optional replicationFactor?: "satellite" | number

    (Cluster only.) Default replication factor for new collections in this database.

  • Optional sharding?: "" | "flexible" | "single"

    (Cluster only.) The sharding method to use for new collections in the database.

  • Optional writeConcern?: number

    (Cluster only.) Default write concern for new collections created in this database.

ExplainOptions

ExplainOptions: { allPlans?: boolean; maxNumberOfPlans?: number; optimizer?: { rules: string[] } }

Options for explaining a query.

See Database.explain.

Type declaration

  • Optional allPlans?: boolean

    If set to true, all possible execution plans will be returned as the plans property. Otherwise only the optimal execution plan will be returned as the plan property.

    Default: false

  • Optional maxNumberOfPlans?: number

    Maximum number of plans that the optimizer is allowed to generate. Setting this to a low value limits the amount of work the optimizer does.

  • Optional optimizer?: { rules: string[] }

    An object with a rules property specifying a list of optimizer rules to be included or excluded by the optimizer for this query. Prefix a rule name with + to include it, or - to exclude it. The name all acts as an alias matching all optimizer rules.

    • rules: string[]

ExplainPlan

ExplainPlan: { collections: { name: string; type: "read" | "write" }[]; estimatedCost: number; estimatedNrItems: number; isModificationQuery: boolean; nodes: { dependencies: number[]; estimatedCost: number; estimatedNrItems: number; id: number; type: string }[]; rules: string[]; variables: { id: number; name: string }[] }

Plan explaining query execution.

Type declaration

  • collections: { name: string; type: "read" | "write" }[]

    Information about collections involved in the query.

  • estimatedCost: number

    Total estimated cost of the plan.

  • estimatedNrItems: number

    Estimated number of items returned by the query.

  • isModificationQuery: boolean

    Whether the query is a data modification query.

  • nodes: { dependencies: number[]; estimatedCost: number; estimatedNrItems: number; id: number; type: string }[]

    Execution nodes in this plan.

  • rules: string[]

    Rules applied by the optimizer.

  • variables: { id: number; name: string }[]

    Variables used in the query.

InstallServiceOptions

InstallServiceOptions: { configuration?: Dict<any>; dependencies?: Dict<string>; development?: boolean; legacy?: boolean; setup?: boolean }

Options for installing the service.

See Database.installService.

Type declaration

  • Optional configuration?: Dict<any>

    An object mapping configuration option names to values.

    See also Database.getServiceConfiguration.

  • Optional dependencies?: Dict<string>

    An object mapping dependency aliases to mount points.

    See also Database.getServiceDependencies.

  • Optional development?: boolean

    Whether the service should be installed in development mode.

    See also Database.setServiceDevelopmentMode.

    Default: false

  • Optional legacy?: boolean

    Whether the service should be installed in legacy compatibility mode

    This overrides the engines option in the service manifest (if any).

    Default: false

  • Optional setup?: boolean

    Whether the "setup" script should be executed.

    Default: true

MultiExplainResult

MultiExplainResult: { cacheable: boolean; plans: ExplainPlan[]; stats: { plansCreated: number; rulesExecuted: number; rulesSkipped: number }; warnings: { code: number; message: string }[] }

Result of explaining a query with multiple plans.

Type declaration

  • cacheable: boolean

    Whether it would be possible to cache the query.

  • plans: ExplainPlan[]

    Query plans.

  • stats: { plansCreated: number; rulesExecuted: number; rulesSkipped: number }

    Statistical information about the query plan generation.

    • plansCreated: number

      Total number of plans created.

    • rulesExecuted: number

      Total number of rules executed for this query.

    • rulesSkipped: number

      Number of rules skipped for this query.

  • warnings: { code: number; message: string }[]

    Warnings encountered while planning the query execution.

MultiServiceDependency

MultiServiceDependency: { current?: string[]; description?: string; multiple: true; name: string; required: boolean; title: string; version: string }

Object describing a multi-service dependency defined by a Foxx service.

Type declaration

  • Optional current?: string[]

    Current mount points the dependency is resolved to.

  • Optional description?: string

    Human-readable description of the dependency.

  • multiple: true

    Whether this is a multi-service dependency.

  • name: string

    Name of the service the dependency expects to match.

  • required: boolean

    Whether the dependency must be matched in order for the service to be operational.

  • title: string

    Formatted name of the dependency.

  • version: string

    Version of the service the dependency expects to match.

ParseResult

ParseResult: { ast: AstNode[]; bindVars: string[]; collections: string[]; parsed: boolean }

Result of parsing a query.

Type declaration

  • ast: AstNode[]

    Abstract syntax tree (AST) of the query.

  • bindVars: string[]

    Names of all bind parameters used in the query.

  • collections: string[]

    Names of all collections involved in the query.

  • parsed: boolean

    Whether the query was parsed.

QueryInfo

QueryInfo: { bindVars: Dict<any>; id: string; query: string; runTime: number; started: string; state: "executing" | "finished" | "killed"; stream: boolean }

Object describing a query.

Type declaration

  • bindVars: Dict<any>

    Bind parameters used in the query.

  • id: string

    Unique identifier for this query.

  • query: string

    Query string (potentially truncated).

  • runTime: number

    Query's running time in seconds.

  • started: string

    Date and time the query was started.

  • state: "executing" | "finished" | "killed"

    Query's current execution state.

  • stream: boolean

    Whether the query uses a streaming cursor.

QueryOptions

QueryOptions: { allowDirtyRead?: boolean; batchSize?: number; cache?: boolean; count?: boolean; failOnWarning?: boolean; fillBlockCache?: boolean; fullCount?: boolean; intermediateCommitCount?: number; intermediateCommitSize?: number; maxNodesPerCallstack?: number; maxPlans?: number; maxRuntime?: number; maxTransactionSize?: number; maxWarningsCount?: number; memoryLimit?: number; optimizer?: { rules: string[] }; profile?: boolean | number; satelliteSyncWait?: number; skipInaccessibleCollections?: boolean; stream?: boolean; timeout?: number; ttl?: number }

Options for executing a query.

See Database.query.

Type declaration

  • Optional allowDirtyRead?: boolean

    If set to true, the query will be executed with support for dirty reads enabled, permitting ArangoDB to return a potentially dirty or stale result and arangojs will load balance the request without distinguishing between leaders and followers.

    Note that dirty reads are only supported for read-only queries, not data modification queries (e.g. using INSERT, UPDATE, REPLACE or REMOVE) and only when using ArangoDB 3.4 or later.

    Default: false

  • Optional batchSize?: number

    Number of result values to be transferred by the server in each network roundtrip (or "batch").

    Must be greater than zero.

  • Optional cache?: boolean

    If set to false, the AQL query results cache lookup will be skipped for this query.

    Default: true

  • Optional count?: boolean

    Unless set to false, the number of result values in the result set will be returned in the count attribute. This may be disabled by default in a future version of ArangoDB if calculating this value has a performance impact for some queries.

    Default: true.

  • Optional failOnWarning?: boolean

    If set to true, the query will throw an exception and abort if it would otherwise produce a warning.

  • Optional fillBlockCache?: boolean

    If set to false, the query data will not be stored in the RocksDB block cache. This can be used to avoid thrashing he block cache when reading a lot of data.

  • Optional fullCount?: boolean

    If set to true and the query has a LIMIT clause, the total number of values matched before the last top-level LIMIT in the query was applied will be returned in the extra.stats.fullCount attribute.

  • Optional intermediateCommitCount?: number

    (RocksDB only.) Maximum number of operations after which an intermediate commit is automatically performed.

  • Optional intermediateCommitSize?: number

    (RocksDB only.) Maximum total size of operations in bytes after which an intermediate commit is automatically performed.

  • Optional maxNodesPerCallstack?: number

    Controls after how many execution nodes in a query a stack split should be performed.

    Default: 250 (200 on macOS)

  • Optional maxPlans?: number

    Limits the maximum number of plans that will be created by the AQL query optimizer.

  • Optional maxRuntime?: number

    Maximum allowed execution time before the query will be killed in seconds.

    If set to 0, the query will be allowed to run indefinitely.

    Default: 0

  • Optional maxTransactionSize?: number

    (RocksDB only.) Maximum size of transactions in bytes.

  • Optional maxWarningsCount?: number

    Limits the maximum number of warnings a query will return.

  • Optional memoryLimit?: number

    Maximum memory size in bytes that the query is allowed to use. Exceeding this value will result in the query failing with an error.

    If set to 0, the memory limit is disabled.

    Default: 0

  • Optional optimizer?: { rules: string[] }

    An object with a rules property specifying a list of optimizer rules to be included or excluded by the optimizer for this query. Prefix a rule name with + to include it, or - to exclude it. The name all acts as an alias matching all optimizer rules.

    • rules: string[]
  • Optional profile?: boolean | number

    If set to 1 or true, additional query profiling information will be returned in the extra.profile attribute if the query is not served from the result cache.

    If set to 2, the query will return execution stats per query plan node in the extra.stats.nodes attribute. Additionally the query plan is returned in extra.plan.

  • Optional satelliteSyncWait?: number

    (Enterprise Edition cluster only.) Limits the maximum time in seconds a DBServer will wait to bring satellite collections involved in the query into sync. Exceeding this value will result in the query being stopped.

    Default: 60

  • Optional skipInaccessibleCollections?: boolean

    (Enterprise Edition cluster only.) If set to true, collections inaccessible to current user will result in an access error instead of being treated as empty.

  • Optional stream?: boolean

    If set to true, the query will be executed as a streaming query.

  • Optional timeout?: number

    Maximum time in milliseconds arangojs will wait for a server response. Exceeding this value will result in the request being cancelled.

    Note: Setting a timeout for the client does not guarantee the query will be killed by ArangoDB if it is already being executed. See the maxRuntime option for limiting the execution time within ArangoDB.

  • Optional ttl?: number

    Time-to-live for the cursor in seconds. The cursor results may be garbage collected by ArangoDB after this much time has passed.

    Default: 30

QueryTracking

QueryTracking: { enabled: boolean; maxQueryStringLength: number; maxSlowQueries: number; slowQueryThreshold: number; trackBindVars: boolean; trackSlowQueries: boolean }

Information about query tracking.

Type declaration

  • enabled: boolean

    Whether query tracking is enabled.

  • maxQueryStringLength: number

    Maximum query string length in bytes that is kept in the list.

  • maxSlowQueries: number

    Maximum number of slow queries that is kept in the list.

  • slowQueryThreshold: number

    Threshold execution time in seconds for when a query is considered slow.

  • trackBindVars: boolean

    Whether bind parameters are being tracked along with queries.

  • trackSlowQueries: boolean

    Whether slow queries are being tracked.

QueryTrackingOptions

QueryTrackingOptions: { enabled?: boolean; maxQueryStringLength?: number; maxSlowQueries?: number; slowQueryThreshold?: number; trackBindVars?: boolean; trackSlowQueries?: boolean }

Options for query tracking.

See Database.queryTracking.

Type declaration

  • Optional enabled?: boolean

    If set to false, neither queries nor slow queries will be tracked.

  • Optional maxQueryStringLength?: number

    Maximum query string length in bytes that will be kept in the list.

  • Optional maxSlowQueries?: number

    Maximum number of slow queries to be kept in the list.

  • Optional slowQueryThreshold?: number

    Threshold execution time in seconds for when a query will be considered slow.

  • Optional trackBindVars?: boolean

    If set to true, bind parameters will be tracked along with queries.

  • Optional trackSlowQueries?: boolean

    If set to true and enabled is also set to true, slow queries will be tracked if their execution time exceeds slowQueryThreshold.

QueueTimeMetrics

QueueTimeMetrics: { getAvg: () => number; getLatest: () => number | undefined; getValues: () => [number, number][] }

An object providing methods for accessing queue time metrics of the most recently received server responses if the server supports this feature.

Type declaration

  • getAvg: () => number

    Returns the average queue time of the most recently received responses in seconds.

      • (): number
      • Returns number

  • getLatest: () => number | undefined

    Returns the queue time of the most recently received response in seconds.

      • (): number | undefined
      • Returns number | undefined

  • getValues: () => [number, number][]

    Returns a list of the most recently received queue time values as tuples of the timestamp of the response being processed in milliseconds and the queue time in seconds.

      • (): [number, number][]
      • Returns [number, number][]

ReplaceServiceOptions

ReplaceServiceOptions: { configuration?: Dict<any>; dependencies?: Dict<string>; development?: boolean; force?: boolean; legacy?: boolean; setup?: boolean; teardown?: boolean }

Options for replacing a service.

See Database.replaceService.

Type declaration

  • Optional configuration?: Dict<any>

    An object mapping configuration option names to values.

    See also Database.getServiceConfiguration.

  • Optional dependencies?: Dict<string>

    An object mapping dependency aliases to mount points.

    See also Database.getServiceDependencies.

  • Optional development?: boolean

    Whether the service should be installed in development mode.

    See also Database.setServiceDevelopmentMode.

    Default: false

  • Optional force?: boolean

    If set to true, replacing a service that does not already exist will fall back to installing the new service.

    Default: false

  • Optional legacy?: boolean

    Whether the service should be installed in legacy compatibility mode

    This overrides the engines option in the service manifest (if any).

    Default: false

  • Optional setup?: boolean

    Whether the "setup" script should be executed.

    Default: true

  • Optional teardown?: boolean

    Whether the existing service's "teardown" script should be executed prior to removing that service.

    Default: true

ServiceConfiguration

ServiceConfiguration: { current: any; currentRaw: any; default?: any; description?: string; required: boolean; title: string; type: "integer" | "boolean" | "string" | "number" | "json" | "password" | "int" | "bool" }

Object describing a configuration option of a Foxx service.

Type declaration

  • current: any

    Processed current value of the configuration option as exposed in the service code.

  • currentRaw: any

    Current value of the configuration option as stored internally.

  • Optional default?: any

    Default value of the configuration option.

  • Optional description?: string

    Human-readable description of the configuration option.

  • required: boolean

    Whether the configuration option must be set in order for the service to be operational.

  • title: string

    Formatted name of the configuration option.

  • type: "integer" | "boolean" | "string" | "number" | "json" | "password" | "int" | "bool"

    Data type of the configuration value.

    Note: "int" and "bool" are historical synonyms for "integer" and "boolean". The "password" type is synonymous with "string" but can be used to distinguish values which should not be displayed in plain text by software when managing the service.

ServiceInfo

ServiceInfo: { checksum: string; development: boolean; legacy: boolean; manifest: FoxxManifest; mount: string; name?: string; options: { configuration: Dict<any>; dependencies: Dict<string> }; path: string; version?: string }

Object describing a Foxx service in detail.

Type declaration

  • checksum: string

    Internal checksum of the service's initial source bundle.

  • development: boolean

    Whether development mode is enabled for this service.

  • legacy: boolean

    Whether the service is running in legacy compatibility mode.

  • manifest: FoxxManifest

    Content of the service manifest of this service.

  • mount: string

    Service mount point, relative to the database.

  • Optional name?: string

    Name defined in the service manifest.

  • options: { configuration: Dict<any>; dependencies: Dict<string> }

    Options for this service.

    • configuration: Dict<any>

      Configuration values set for this service.

    • dependencies: Dict<string>

      Service dependency configuration of this service.

  • path: string

    File system path of the service.

  • Optional version?: string

    Version defined in the service manifest.

ServiceSummary

ServiceSummary: { development: boolean; legacy: boolean; mount: string; name?: string; provides: Dict<string>; version?: string }

Object briefly describing a Foxx service.

Type declaration

  • development: boolean

    Whether development mode is enabled for this service.

  • legacy: boolean

    Whether the service is running in legacy compatibility mode.

  • mount: string

    Service mount point, relative to the database.

  • Optional name?: string

    Name defined in the service manifest.

  • provides: Dict<string>

    Service dependencies the service expects to be able to match as a mapping from dependency names to versions the service is compatible with.

  • Optional version?: string

    Version defined in the service manifest.

ServiceTestDefaultReport

ServiceTestDefaultReport: { failures: ServiceTestDefaultTest[]; passes: ServiceTestDefaultTest[]; pending: ServiceTestDefaultTest[]; stats: ServiceTestStats; tests: ServiceTestDefaultTest[] }

Test results for a Foxx service's tests using the default reporter.

Type declaration

ServiceTestDefaultTest

ServiceTestDefaultTest: { duration: number; err?: string; fullTitle: string; title: string }

Test results for a single test case using the default reporter.

Type declaration

  • duration: number
  • Optional err?: string
  • fullTitle: string
  • title: string

ServiceTestStats

ServiceTestStats: { duration: number; failures: number; passes: number; pending: number; tests: number }

Test stats for a Foxx service's tests.

Type declaration

  • duration: number

    Total test duration in milliseconds.

  • failures: number

    Number of tests that failed.

  • passes: number

    Number of tests that ran successfully.

  • pending: number

    Number of tests skipped or not executed.

  • tests: number

    Total number of tests found.

ServiceTestStreamReport

ServiceTestStreamReport: (["start", { total: number }] | ["pass", ServiceTestStreamTest] | ["fail", ServiceTestStreamTest] | ["end", ServiceTestStats])[]

Test results for a Foxx service's tests using the stream reporter.

ServiceTestStreamTest

ServiceTestStreamTest: { duration: number; err?: string; fullTitle: string; title: string }

Test results for a single test case using the stream reporter.

Type declaration

  • duration: number
  • Optional err?: string
  • fullTitle: string
  • title: string

ServiceTestSuite

ServiceTestSuite: { suites: ServiceTestSuite[]; tests: ServiceTestSuiteTest[]; title: string }

Test results for a single test suite using the suite reporter.

Type declaration

ServiceTestSuiteReport

ServiceTestSuiteReport: { stats: ServiceTestStats; suites: ServiceTestSuite[]; tests: ServiceTestSuiteTest[] }

Test results for a Foxx service's tests using the suite reporter.

Type declaration

ServiceTestSuiteTest

ServiceTestSuiteTest: { duration: number; err?: any; result: "pending" | "pass" | "fail"; title: string }

Test results for a single test case using the suite reporter.

Type declaration

  • duration: number
  • Optional err?: any
  • result: "pending" | "pass" | "fail"
  • title: string

ServiceTestTapReport

ServiceTestTapReport: string[]

Test results for a Foxx service's tests in TAP format.

ServiceTestXunitReport

ServiceTestXunitReport: ["testsuite", { errors: number; failures: number; skip: number; tests: number; time: number; timestamp: number }, ...ServiceTestXunitTest[]]

Test results for a Foxx service's tests in XUnit format using the JSONML representation.

ServiceTestXunitTest

ServiceTestXunitTest: ["testcase", { classname: string; name: string; time: number }] | ["testcase", { classname: string; name: string; time: number }, ["failure", { message: string; type: string }, string]]

Test results for a single test case in XUnit format using the JSONML representation.

SingleExplainResult

SingleExplainResult: { cacheable: boolean; plan: ExplainPlan; stats: { plansCreated: number; rulesExecuted: number; rulesSkipped: number }; warnings: { code: number; message: string }[] }

Result of explaining a query with a single plan.

Type declaration

  • cacheable: boolean

    Whether it would be possible to cache the query.

  • plan: ExplainPlan

    Query plan.

  • stats: { plansCreated: number; rulesExecuted: number; rulesSkipped: number }

    Statistical information about the query plan generation.

    • plansCreated: number

      Total number of plans created.

    • rulesExecuted: number

      Total number of rules executed for this query.

    • rulesSkipped: number

      Number of rules skipped for this query.

  • warnings: { code: number; message: string }[]

    Warnings encountered while planning the query execution.

SingleServiceDependency

SingleServiceDependency: { current?: string; description?: string; multiple: false; name: string; required: boolean; title: string; version: string }

Object describing a single-service dependency defined by a Foxx service.

Type declaration

  • Optional current?: string

    Current mount point the dependency is resolved to.

  • Optional description?: string

    Human-readable description of the dependency.

  • multiple: false

    Whether this is a multi-service dependency.

  • name: string

    Name of the service the dependency expects to match.

  • required: boolean

    Whether the dependency must be matched in order for the service to be operational.

  • title: string

    Formatted name of the dependency.

  • version: string

    Version of the service the dependency expects to match.

SwaggerJson

SwaggerJson: { info: { description: string; license: string; title: string; version: string }; path: {} }

OpenAPI 2.0 description of a Foxx service.

Type declaration

  • [key: string]: any
  • info: { description: string; license: string; title: string; version: string }
    • description: string
    • license: string
    • title: string
    • version: string
  • path: {}
    • [key: string]: any

TransactionCollections

TransactionCollections: { exclusive?: (string | ArangoCollection)[] | string | ArangoCollection; read?: (string | ArangoCollection)[] | string | ArangoCollection; write?: (string | ArangoCollection)[] | string | ArangoCollection }

Collections involved in a transaction.

Type declaration

  • Optional exclusive?: (string | ArangoCollection)[] | string | ArangoCollection

    An array of collections or a single collection that will be read from or written to during the transaction with no other writes being able to run in parallel.

  • Optional read?: (string | ArangoCollection)[] | string | ArangoCollection

    An array of collections or a single collection that will be read from during the transaction.

  • Optional write?: (string | ArangoCollection)[] | string | ArangoCollection

    An array of collections or a single collection that will be read from or written to during the transaction.

    If ArangoDB is using the MMFiles storage engine, this option behaves exactly like exclusive, i.e. no other writes will run in parallel.

TransactionDetails

TransactionDetails: { id: string; state: "running" | "committed" | "aborted" }

Details for a transaction.

See also TransactionStatus.

Type declaration

  • id: string

    Unique identifier of the transaction.

  • state: "running" | "committed" | "aborted"

    Status (or "state") of the transaction.

TransactionOptions

TransactionOptions: { allowImplicit?: boolean; intermediateCommitCount?: number; intermediateCommitSize?: number; lockTimeout?: number; maxTransactionSize?: number; waitForSync?: boolean }

Options for how the transaction should be performed.

Type declaration

  • Optional allowImplicit?: boolean

    Whether the transaction may read from collections not specified for this transaction. If set to false, accessing any collections not specified will result in the transaction being aborted to avoid potential deadlocks.

    Default: true.

  • Optional intermediateCommitCount?: number

    (RocksDB only.) Determines the maximum number of operations after which an intermediate commit is performed automatically.

    deprecated

    Removed in ArangoDB 3.4.

  • Optional intermediateCommitSize?: number

    (RocksDB only.) Determine the maximum total size of operations after which an intermediate commit is performed automatically.

    deprecated

    Removed in ArangoDB 3.4.

  • Optional lockTimeout?: number

    Determines how long the database will wait while attempting to gain locks on collections used by the transaction before timing out.

  • Optional maxTransactionSize?: number

    (RocksDB only.) Determines the transaction size limit in bytes.

  • Optional waitForSync?: boolean

    Determines whether to force the transaction to write all data to disk before returning.

UninstallServiceOptions

UninstallServiceOptions: { force?: boolean; teardown?: boolean }

Options for uninstalling a service.

See Database.uninstallService.

Type declaration

  • Optional force?: boolean

    If set to true, uninstalling a service that does not already exist will be considered successful.

    Default: false

  • Optional teardown?: boolean

    Whether the service's "teardown" script should be executed prior to removing that service.

    Default: true

UpgradeServiceOptions

UpgradeServiceOptions: { configuration?: Dict<any>; dependencies?: Dict<string>; development?: boolean; force?: boolean; legacy?: boolean; setup?: boolean; teardown?: boolean }

Options for upgrading a service.

See Database.upgradeService.

Type declaration

  • Optional configuration?: Dict<any>

    An object mapping configuration option names to values.

    See also Database.getServiceConfiguration.

  • Optional dependencies?: Dict<string>

    An object mapping dependency aliases to mount points.

    See also Database.getServiceDependencies.

  • Optional development?: boolean

    Whether the service should be installed in development mode.

    See also Database.setServiceDevelopmentMode.

    Default: false

  • Optional force?: boolean

    Unless set to true, upgrading a service that does not already exist will fall back to installing the new service.

    Default: false

  • Optional legacy?: boolean

    Whether the service should be installed in legacy compatibility mode

    This overrides the engines option in the service manifest (if any).

    Default: false

  • Optional setup?: boolean

    Whether the "setup" script should be executed.

    Default: true

  • Optional teardown?: boolean

    Whether the existing service's "teardown" script should be executed prior to upgrading that service.

    Default: false

UserAccessLevelOptions

UserAccessLevelOptions: { collection?: ArangoCollection | string; database?: Database | string }

Options for accessing or manipulating access levels.

Type declaration

  • Optional collection?: ArangoCollection | string

    The collection to access or manipulate the access level of.

  • Optional database?: Database | string

    The database to access or manipulate the access level of.

    If collection is an ArangoCollection, this option defaults to the database the collection is contained in. Otherwise this option defaults to the current database.

UserOptions

UserOptions: { active?: boolean; extra?: Record<string, any>; passwd: string }

Options for modifying an ArangoDB user.

Type declaration

  • Optional active?: boolean

    Whether the ArangoDB user account is enabled and can authenticate.

    Default: true

  • Optional extra?: Record<string, any>

    Additional information to store about this user.

    Default: {}

  • passwd: string

    Password the ArangoDB user will use for authentication.

VersionInfo

VersionInfo: { details?: {}; license: "community" | "enterprise"; server: string; version: string }

Result of retrieving database version information.

Type declaration

  • Optional details?: {}

    Additional information about the ArangoDB server.

    • [key: string]: string
  • license: "community" | "enterprise"

    ArangoDB license type or "edition".

  • server: string

    Value identifying the server type, i.e. "arango".

  • version: string

    ArangoDB server version.

Functions

isArangoDatabase

  • isArangoDatabase(database: any): database is Database
  • Indicates whether the given value represents a Database.

    Parameters

    • database: any

      A value that might be a database.

    Returns database is Database

Generated using TypeDoc