Options
All
  • Public
  • Public/Protected
  • All
Menu

Module collection

import type {
  DocumentCollection,
  EdgeCollection,
} from "arangojs/collection";

The "collection" module provides collection related types and interfaces for TypeScript.

Index

Type aliases

CollectionBatchReadOptions

CollectionBatchReadOptions: { allowDirtyRead?: boolean }

Options for retrieving multiple documents from a collection.

Type declaration

  • Optional allowDirtyRead?: boolean

    If set to true, the request will explicitly permit ArangoDB to return a potentially dirty or stale result and arangojs will load balance the request without distinguishing between leaders and followers.

CollectionChecksumOptions

CollectionChecksumOptions: { withData?: boolean; withRevisions?: boolean }

Options for retrieving a collection checksum.

Type declaration

  • Optional withData?: boolean

    If set to true, document data will be included in the calculation of the checksum.

    Default: false

  • Optional withRevisions?: boolean

    If set to true, revision IDs will be included in the calculation of the checksum.

    Default: false

CollectionDropOptions

CollectionDropOptions: { isSystem?: boolean }

Options for dropping collections.

Type declaration

  • Optional isSystem?: boolean

    Whether the collection is a system collection. If the collection is a system collection, this option must be set to true or ArangoDB will refuse to drop the collection.

    Default: false

CollectionEdgesResult

CollectionEdgesResult<T>: { edges: Edge<T>[]; stats: { filtered: number; scannedIndex: number } }

Result of retrieving edges in a collection.

Type parameters

  • T: Record<string, any> = any

Type declaration

  • edges: Edge<T>[]
  • stats: { filtered: number; scannedIndex: number }
    • filtered: number
    • scannedIndex: number

CollectionImportOptions

CollectionImportOptions: { complete?: boolean; details?: boolean; fromPrefix?: string; onDuplicate?: "error" | "update" | "replace" | "ignore"; overwrite?: boolean; toPrefix?: string; waitForSync?: boolean }

Options for bulk importing documents into a collection.

Type declaration

  • Optional complete?: boolean

    If set to true, the import will abort if any error occurs.

  • Optional details?: boolean

    Whether the response should contain additional details about documents that could not be imported.

  • Optional fromPrefix?: string

    (Edge collections only.) Prefix to prepend to _from attribute values.

  • Optional onDuplicate?: "error" | "update" | "replace" | "ignore"

    Controls behavior when a unique constraint is violated on the document key.

    • "error": the document will not be imported.
    • "update: the document will be merged into the existing document.
    • "replace": the document will replace the existing document.
    • "ignore": the document will not be imported and the unique constraint error will be ignored.

    Default: "error"

  • Optional overwrite?: boolean

    If set to true, the collection is truncated before the data is imported.

    Default: false

  • Optional toPrefix?: string

    (Edge collections only.) Prefix to prepend to _to attribute values.

  • Optional waitForSync?: boolean

    Whether to wait for the documents to have been synced to disk.

CollectionImportResult

CollectionImportResult: { created: number; details?: string[]; empty: number; error: false; errors: number; ignored: number; updated: number }

Result of a collection bulk import.

Type declaration

  • created: number

    Number of new documents imported.

  • Optional details?: string[]

    Additional details about any errors encountered during the import.

  • empty: number

    Number of empty documents.

  • error: false

    Whether the import failed.

  • errors: number

    Number of documents that failed with an error.

  • ignored: number

    Number of documents that failed with an error that is ignored.

  • updated: number

    Number of documents updated.

CollectionInsertOptions

CollectionInsertOptions: { overwrite?: boolean; overwriteMode?: "ignore" | "update" | "replace" | "conflict"; returnNew?: boolean; silent?: boolean; waitForSync?: boolean }

Options for inserting a new document into a collection.

Type declaration

  • Optional overwrite?: boolean

    If set to true, a document with the same _key or _id already existing will be overwritten instead of resulting in an exception.

    deprecated

    This option has been deprecated in ArangoDB 3.7 and replaced with the overwriteMode option.

  • Optional overwriteMode?: "ignore" | "update" | "replace" | "conflict"

    Defines what should happen if a document with the same _key or _id already exists, instead of throwing an exception.

    Default: `"conflict"

  • Optional returnNew?: boolean

    If set to true, the complete new document will be returned as the new property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional silent?: boolean

    If set to true, no data will be returned by the server. This option can be used to reduce network traffic.

    Default: false

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning.

    Default: false

CollectionKeyOptions

CollectionKeyOptions: { allowUserKeys?: boolean; increment?: number; offset?: number; type?: KeyGenerator }

An object defining the collection's key generation.

Type declaration

  • Optional allowUserKeys?: boolean

    Unless set to false, documents can be created with a user-specified _key attribute.

    Default: true

  • Optional increment?: number

    (Autoincrement only.) How many steps to increment the key each time.

  • Optional offset?: number

    (Autoincrement only.) Initial offset for the key.

  • Optional type?: KeyGenerator

    Type of key generator to use.

CollectionKeyProperties

CollectionKeyProperties: { allowUserKeys: boolean; increment?: number; lastValue: number; offset?: number; type: KeyGenerator }

An object defining the collection's key generation.

Type declaration

  • allowUserKeys: boolean

    Whether documents can be created with a user-specified _key attribute.

  • Optional increment?: number

    (Autoincrement only.) How many steps to increment the key each time.

  • lastValue: number

    Most recent key that has been generated.

  • Optional offset?: number

    (Autoincrement only.) Initial offset for the key.

  • type: KeyGenerator

    Type of key generator to use.

CollectionMetadata

CollectionMetadata: { globallyUniqueId: string; isSystem: boolean; name: string; status: CollectionStatus; type: CollectionType }

General information about a collection.

Type declaration

  • globallyUniqueId: string

    A globally unique identifier for this collection.

  • isSystem: boolean
    internal

    Whether the collection is a system collection.

  • name: string

    Collection name.

  • status: CollectionStatus

    An integer indicating the collection loading status.

  • type: CollectionType

    An integer indicating the collection type.

CollectionProperties

CollectionProperties: { distributeShardsLike?: string; doCompact?: boolean; indexBuckets?: number; isVolatile?: boolean; journalSize?: number; keyOptions: CollectionKeyProperties; minReplicationFactor?: number; numberOfShards?: number; replicationFactor?: number; schema: SchemaProperties | null; shardKeys?: string[]; shardingStrategy?: ShardingStrategy; smartJoinAttribute?: string; statusString: string; waitForSync: boolean; writeConcern: number }

An object defining the properties of a collection.

Type declaration

  • Optional distributeShardsLike?: string

    (Enterprise Edition cluster only.) If set to a collection name, sharding of the new collection will follow the rules for that collection. As long as the new collection exists, the indicated collection can not be dropped.

  • Optional doCompact?: boolean

    (MMFiles only.) Whether the collection will be compacted.

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional indexBuckets?: number

    (MMFiles only.) Number of buckets into which indexes using hash tables are split.

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional isVolatile?: boolean

    (MMFiles only.) If set to true, the collection will only be kept in-memory and discarded when unloaded, resulting in full data loss.

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional journalSize?: number

    (MMFiles only.) Maximum size for each journal or datafile in bytes.

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • keyOptions: CollectionKeyProperties

    An object defining the collection's key generation.

  • Optional minReplicationFactor?: number

    (Cluster only.) Write concern for this collection.

    deprecated

    Renamed to writeConcern in ArangoDB 3.6.

  • Optional numberOfShards?: number

    (Cluster only.) Number of shards of this collection.

  • Optional replicationFactor?: number

    (Cluster only.) Replication factor of the collection.

  • schema: SchemaProperties | null

    Properties for validating documents in the collection.

  • Optional shardKeys?: string[]

    (Cluster only.) Keys of this collection that will be used for sharding.

  • Optional shardingStrategy?: ShardingStrategy

    (Cluster only.) Sharding strategy of the collection.

  • Optional smartJoinAttribute?: string

    (Enterprise Edition cluster only.) Attribute containing the shard key value of the referred-to smart join collection.

  • statusString: string

    A human-readable representation of the collection loading status.

  • waitForSync: boolean

    Whether data should be synchronized to disk before returning from a document create, update, replace or removal operation.

  • writeConcern: number

    (Cluster only.) Write concern for this collection.

CollectionPropertiesOptions

CollectionPropertiesOptions: { journalSize?: number; schema?: SchemaOptions; waitForSync?: boolean }

Options for setting a collection's properties.

See DocumentCollection.properties and EdgeCollection.properties.

Type declaration

  • Optional journalSize?: number

    (MMFiles only.) Maximum size for each journal or datafile in bytes.

    Must be a number greater than or equal to 1048576 (1 MiB).

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional schema?: SchemaOptions

    Options for validating documents in this collection.

  • Optional waitForSync?: boolean

    Whether data should be synchronized to disk before returning from a document create, update, replace or removal operation.

CollectionReadOptions

CollectionReadOptions: { allowDirtyRead?: boolean; graceful?: boolean }

Options for retrieving a document from a collection.

Type declaration

  • Optional allowDirtyRead?: boolean

    If set to true, the request will explicitly permit ArangoDB to return a potentially dirty or stale result and arangojs will load balance the request without distinguishing between leaders and followers.

  • Optional graceful?: boolean

    If set to true, null is returned instead of an exception being thrown if the document does not exist.

CollectionRemoveOptions

CollectionRemoveOptions: { returnOld?: boolean; silent?: boolean; waitForSync?: boolean }

Options for removing a document from a collection.

Type declaration

  • Optional returnOld?: boolean

    If set to true, the complete old document will be returned as the old property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional silent?: boolean

    If set to true, no data will be returned by the server. This option can be used to reduce network traffic.

    Default: false

  • Optional waitForSync?: boolean

    If set to true, changes will be synchronized to disk before returning.

    Default: false

CollectionReplaceOptions

CollectionReplaceOptions: { ignoreRevs?: boolean; returnNew?: boolean; returnOld?: boolean; silent?: boolean; waitForSync?: boolean }

Options for replacing an existing document in a collection.

Type declaration

  • Optional ignoreRevs?: boolean

    If set to false, the existing document will only be modified if its _rev property matches the same property on the new data.

    Default: true

  • Optional returnNew?: boolean

    If set to true, the complete new document will be returned as the new property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional returnOld?: boolean

    If set to true, the complete old document will be returned as the old property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional silent?: boolean

    If set to true, no data will be returned by the server. This option can be used to reduce network traffic.

    Default: false

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning.

    Default: false

CollectionUpdateOptions

CollectionUpdateOptions: { ignoreRevs?: boolean; keepNull?: boolean; mergeObjects?: boolean; returnNew?: boolean; returnOld?: boolean; silent?: boolean; waitForSync?: boolean }

Options for updating a document in a collection.

Type declaration

  • Optional ignoreRevs?: boolean

    If set to false, the existing document will only be modified if its _rev property matches the same property on the new data.

    Default: true

  • Optional keepNull?: boolean

    If set to false, properties with a value of null will be removed from the new document.

    Default: true

  • Optional mergeObjects?: boolean

    If set to false, object properties that already exist in the old document will be overwritten rather than merged. This does not affect arrays.

    Default: true

  • Optional returnNew?: boolean

    If set to true, the complete new document will be returned as the new property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional returnOld?: boolean

    If set to true, the complete old document will be returned as the old property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional silent?: boolean

    If set to true, no data will be returned by the server. This option can be used to reduce network traffic.

    Default: false

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning.

    Default: false

CreateCollectionOptions

CreateCollectionOptions: { distributeShardsLike?: string; doCompact?: boolean; enforceReplicationFactor?: boolean; indexBuckets?: number; isSystem?: boolean; isVolatile?: boolean; journalSize?: number; keyOptions?: CollectionKeyOptions; minReplicationFactor?: number; numberOfShards?: number; replicationFactor?: number; schema?: SchemaOptions; shardKeys?: string[]; shardingStrategy?: ShardingStrategy; smartJoinAttribute?: string; waitForSync?: boolean; waitForSyncReplication?: boolean; writeConcern?: number }

Type declaration

  • Optional distributeShardsLike?: string

    (Enterprise Edition cluster only.) If set to a collection name, sharding of the new collection will follow the rules for that collection. As long as the new collection exists, the indicated collection can not be dropped.

  • Optional doCompact?: boolean

    (MMFiles only.) Whether the collection will be compacted.

    Default: true

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional enforceReplicationFactor?: boolean

    (Cluster only.) Unless set to false, the server will check whether enough replicas are available at creation time and bail out otherwise.

    Default: true

  • Optional indexBuckets?: number

    (MMFiles only.) Number of buckets into which indexes using hash tables are split.

    Must be a power of 2 and less than or equal to 1024.

    Default: 16

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional isSystem?: boolean
    internal

    Whether the collection should be created as a system collection.

    Default: false

  • Optional isVolatile?: boolean

    (MMFiles only.) If set to true, the collection will only be kept in-memory and discarded when unloaded, resulting in full data loss.

    Default: false

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional journalSize?: number

    (MMFiles only.) Maximum size for each journal or datafile in bytes.

    Must be a number greater than or equal to 1048576 (1 MiB).

    deprecated

    The MMFiles storage engine was removed in ArangoDB 3.7.

  • Optional keyOptions?: CollectionKeyOptions

    An object defining the collection's key generation.

  • Optional minReplicationFactor?: number

    (Cluster only.) Write concern for this collection.

    deprecated

    Renamed to writeConcern in ArangoDB 3.6.

  • Optional numberOfShards?: number

    (Cluster only.) Number of shards to distribute the collection across.

    Default: 1

  • Optional replicationFactor?: number

    (Cluster only.) How many copies of each document should be kept in the cluster.

    Default: 1

  • Optional schema?: SchemaOptions

    Options for validating documents in the collection.

  • Optional shardKeys?: string[]

    (Cluster only.) Document attributes to use to determine the target shard for each document.

    Default: ["_key"]

  • Optional shardingStrategy?: ShardingStrategy

    (Cluster only.) Sharding strategy to use.

  • Optional smartJoinAttribute?: string

    (Enterprise Edition cluster only.) Attribute containing the shard key value of the referred-to smart join collection.

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning from a document create, update, replace or removal operation.

    Default: false

  • Optional waitForSyncReplication?: boolean

    (Cluster only.) Unless set to false, the server will wait for all replicas to create the collection before returning.

    Default: true

  • Optional writeConcern?: number

    (Cluster only.) Write concern for this collection.

KeyGenerator

KeyGenerator: "traditional" | "autoincrement" | "uuid" | "padded"

Type of key generator.

SchemaOptions

SchemaOptions: { level?: ValidationLevel; message?: string; rule: any }

Options for validating collection documents.

Type declaration

  • Optional level?: ValidationLevel

    When validation should be applied.

    Default: "strict"

  • Optional message?: string

    Message to be used if validation fails.

  • rule: any

    JSON Schema description of the validation schema for documents.

SchemaProperties

SchemaProperties: { level: ValidationLevel; message: string; rule: any; type: "json" }

Properties for validating documents in a collection.

Type declaration

  • level: ValidationLevel

    When validation should be applied.

  • message: string

    Message to be used if validation fails.

  • rule: any

    JSON Schema description of the validation schema for documents.

  • type: "json"

    Type of document validation.

ShardingStrategy

ShardingStrategy: "hash" | "enterprise-hash-smart-edge" | "community-compat" | "enterprise-compat" | "enterprise-smart-edge-compat"

Strategy for sharding a collection.

SimpleQueryAllOptions

SimpleQueryAllOptions: { batchSize?: number; limit?: number; skip?: number; stream?: boolean; ttl?: number }

Options for retrieving all documents in a collection.

deprecated

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

Type declaration

  • Optional batchSize?: number

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

    Must be greater than zero.

    See also QueryOptions.

  • Optional limit?: number

    Maximum number of documents to return.

  • Optional skip?: number

    Number of documents to skip in the query.

  • Optional stream?: boolean

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

    See also QueryOptions.

  • 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.

    See also QueryOptions.

SimpleQueryByExampleOptions

SimpleQueryByExampleOptions: { batchSize?: number; limit?: number; skip?: number; ttl?: number }

Options for retrieving documents by example.

deprecated

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

Type declaration

  • Optional batchSize?: number

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

    Must be greater than zero.

    See also QueryOptions.

  • Optional limit?: number

    Maximum number of documents to return.

  • Optional skip?: number

    Number of documents to skip in the query.

  • 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.

    See also QueryOptions.

SimpleQueryFulltextOptions

SimpleQueryFulltextOptions: { index?: string; limit?: number; skip?: number }

Options for performing a fulltext query.

deprecated

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

Type declaration

  • Optional index?: string

    Unique identifier of the fulltext index to use to perform the query.

  • Optional limit?: number

    Maximum number of documents to return.

  • Optional skip?: number

    Number of documents to skip in the query.

SimpleQueryListType

SimpleQueryListType: "id" | "key" | "path"

Type of document reference.

See DocumentCollection.list and EdgeCollection.list.

deprecated

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

SimpleQueryRemoveByExampleOptions

SimpleQueryRemoveByExampleOptions: { limit?: number; waitForSync?: boolean }

Options for removing documents by example.

deprecated

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

Type declaration

  • Optional limit?: number

    Maximum number of documents to return.

  • Optional waitForSync?: boolean

    If set to true, the request will wait until all modifications have been synchronized to disk before returning successfully.

    Default: false

SimpleQueryRemoveByExampleResult

SimpleQueryRemoveByExampleResult: { deleted: number }

Result of removing documents by an example.

See DocumentCollection.removeByExample and EdgeCollection.removeByExample.

deprecated

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

Type declaration

  • deleted: number

    Number of documents removed.

SimpleQueryRemoveByKeysOptions

SimpleQueryRemoveByKeysOptions: { returnOld?: boolean; silent?: boolean; waitForSync?: boolean }

Options for removing documents by keys.

deprecated

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

Type declaration

  • Optional returnOld?: boolean

    If set to true, the complete old document will be returned as the old property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional silent?: boolean

    If set to true, no data will be returned by the server. This option can be used to reduce network traffic.

    Default: false

  • Optional waitForSync?: boolean

    If set to true, the request will wait until all modifications have been synchronized to disk before returning successfully.

    Default: false

SimpleQueryRemoveByKeysResult

SimpleQueryRemoveByKeysResult<T>: { ignored: number; old?: DocumentMetadata[] | Document<T>[]; removed: number }

Result of removing documents by keys.

See DocumentCollection.removeByKeys and EdgeCollection.removeByKeys.

deprecated

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

Type parameters

  • T: Record<string, any> = any

Type declaration

  • ignored: number

    Number of documents not removed.

  • Optional old?: DocumentMetadata[] | Document<T>[]

    Documents that have been removed.

  • removed: number

    Number of documents removed.

SimpleQueryReplaceByExampleOptions

SimpleQueryReplaceByExampleOptions: SimpleQueryRemoveByExampleOptions

Options for replacing documents by example.

deprecated

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

SimpleQueryReplaceByExampleResult

SimpleQueryReplaceByExampleResult: { replaced: number }

Result of replacing documents by an example.

See DocumentCollection.replaceByExample and EdgeCollection.replaceByExample.

deprecated

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

Type declaration

  • replaced: number

    Number of documents replaced.

SimpleQueryUpdateByExampleOptions

SimpleQueryUpdateByExampleOptions: { keepNull?: boolean; limit?: number; mergeObjects?: boolean; waitForSync?: boolean }

Options for updating documents by example.

deprecated

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

Type declaration

  • Optional keepNull?: boolean

    If set to false, properties with a value of null will be removed from the new document.

    Default: true

  • Optional limit?: number

    Maximum number of documents to return.

  • Optional mergeObjects?: boolean

    If set to false, object properties that already exist in the old document will be overwritten rather than merged. This does not affect arrays.

    Default: true

  • Optional waitForSync?: boolean

    If set to true, the request will wait until all modifications have been synchronized to disk before returning successfully.

    Default: false

SimpleQueryUpdateByExampleResult

SimpleQueryUpdateByExampleResult: { updated: number }

Result of updating documents by an example.

See DocumentCollection.updateByExample and EdgeCollection.updateByExample.

deprecated

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

Type declaration

  • updated: number

    Number of documents updated.

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 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.

ValidationLevel

ValidationLevel: "none" | "new" | "moderate" | "strict"

When a validation should be applied.

  • "none": No validation.
  • "new": Newly inserted documents are validated.
  • "moderate": New and modified documents are validated unless the modified document was already invalid.
  • "strict": New and modified documents are always validated.

Functions

collectionToString

isArangoCollection

  • Indicates whether the given value represents an ArangoCollection.

    Parameters

    • collection: any

      A value that might be a collection.

    Returns collection is ArangoCollection

Generated using TypeDoc