Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "collection"

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

TODO

Index

Type aliases

CollectionChecksum

CollectionChecksum: { checksum: string }

TODO

Type declaration

  • checksum: string

    TODO

CollectionChecksumOptions

CollectionChecksumOptions: { withData?: undefined | false | true; withRevisions?: undefined | false | true }

TODO

Type declaration

  • Optional withData?: undefined | false | true

    TODO

  • Optional withRevisions?: undefined | false | true

    TODO

CollectionCount

CollectionCount: { count: number }

TODO

Type declaration

  • count: number

    The number of documents in this collection.

CollectionDropOptions

CollectionDropOptions: { isSystem?: undefined | false | true }

Options for dropping collections.

Type declaration

  • Optional isSystem?: undefined | false | true

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

TODO

Type parameters

  • T: object

Type declaration

  • edges: Edge<T>[]

    TODO

  • stats: { filtered: number; scannedIndex: number }

    TODO

    • filtered: number

      TODO

    • scannedIndex: number

      TODO

CollectionFigures

CollectionFigures: { figures: { alive: { count: number; size: number }; attributes: { count: number; size: number }; compactionStatus: { bytesRead: number; bytesWritten: number; count: number; filesCombined: number; message: string; time: string }; compactors: { count: number; fileSize: number }; datafiles: { count: number; fileSize: number }; dead: { count: number; deletion: number; size: number }; documentReferences: number; indexes: { count: number; size: number }; journals: { count: number; fileSize: number }; lastTick: number; shapefiles: { count: number; fileSize: number }; shapes: { count: number; size: number }; uncollectedLogfileEntries: number; waitingFor: string } }

TODO

Type declaration

  • figures: { alive: { count: number; size: number }; attributes: { count: number; size: number }; compactionStatus: { bytesRead: number; bytesWritten: number; count: number; filesCombined: number; message: string; time: string }; compactors: { count: number; fileSize: number }; datafiles: { count: number; fileSize: number }; dead: { count: number; deletion: number; size: number }; documentReferences: number; indexes: { count: number; size: number }; journals: { count: number; fileSize: number }; lastTick: number; shapefiles: { count: number; fileSize: number }; shapes: { count: number; size: number }; uncollectedLogfileEntries: number; waitingFor: string }

    TODO

    • alive: { count: number; size: number }

      TODO

      • count: number
      • size: number
    • attributes: { count: number; size: number }

      TODO

      • count: number
      • size: number
    • compactionStatus: { bytesRead: number; bytesWritten: number; count: number; filesCombined: number; message: string; time: string }

      TODO

      • bytesRead: number

        TODO

      • bytesWritten: number

        TODO

      • count: number

        TODO

      • filesCombined: number

        TODO

      • message: string

        TODO

      • time: string

        TODO

    • compactors: { count: number; fileSize: number }

      TODO

      • count: number
      • fileSize: number
    • datafiles: { count: number; fileSize: number }

      TODO

      • count: number
      • fileSize: number
    • dead: { count: number; deletion: number; size: number }

      TODO

      • count: number
      • deletion: number
      • size: number
    • documentReferences: number

      TODO

    • indexes: { count: number; size: number }

      TODO

      • count: number
      • size: number
    • journals: { count: number; fileSize: number }

      TODO

      • count: number
      • fileSize: number
    • lastTick: number

      TODO

    • shapefiles: { count: number; fileSize: number }

      TODO

      • count: number
      • fileSize: number
    • shapes: { count: number; size: number }

      TODO

      • count: number
      • size: number
    • uncollectedLogfileEntries: number

      TODO

    • waitingFor: string

      TODO

CollectionImportOptions

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

TODO

Type declaration

  • Optional complete?: undefined | false | true

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

  • Optional details?: undefined | false | true

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

  • Optional fromPrefix?: undefined | 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.

    • "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?: undefined | false | true

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

    Default: false

  • Optional toPrefix?: undefined | string

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

  • Optional waitForSync?: undefined | false | true

    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 }

The result of a collection bulk import.

Type declaration

  • created: number

    The number of new documents imported.

  • Optional details?: string[]

    Additional details about any errors encountered during the import.

  • empty: number

    The number of empty documents.

  • error: false

    Whether the import failed.

  • errors: number

    The number of documents that failed with an error.

  • ignored: number

    The number of documents that failed with an error that is ignored.

  • updated: number

    The number of documents updated.

CollectionIndexResult

CollectionIndexResult: { id: string }

TODO

Type declaration

  • id: string

    TODO

CollectionInsertOptions

CollectionInsertOptions: CollectionSaveOptions & { overwrite?: undefined | false | true; overwriteMode?: "update" | "replace" }

TODO

CollectionInsertResult

CollectionInsertResult<T>: DocumentMetadata & { new?: T }

TODO

Type parameters

  • T

CollectionKeyOptions

CollectionKeyOptions: { allowUserKeys?: undefined | false | true; increment?: undefined | number; offset?: undefined | number; type?: KeyGenerator }

An object defining the collection's key generation.

Type declaration

  • Optional allowUserKeys?: undefined | false | true

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

    Default: true

  • Optional increment?: undefined | number

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

  • Optional offset?: undefined | number

    (Autoincrement only.) The initial offset for the key.

  • Optional type?: KeyGenerator

    Type of key generator to use.

CollectionKeyProperties

CollectionKeyProperties: { allowUserKeys: boolean; increment?: undefined | number; lastValue: number; offset?: undefined | 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?: undefined | number

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

  • lastValue: number

    The most recent key that has been generated.

  • Optional offset?: undefined | number

    (Autoincrement only.) The 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

    The collection name.

  • status: CollectionStatus

    An integer indicating the collection loading status.

  • type: CollectionType

    An integer indicating the collection type.

CollectionProperties

CollectionProperties: CollectionMetadata & { distributeShardsLike?: undefined | string; doCompact?: undefined | false | true; indexBuckets?: undefined | number; isVolatile?: undefined | false | true; journalSize?: undefined | number; keyOptions: CollectionKeyProperties; minReplicationFactor: number; numberOfShards?: undefined | number; replicationFactor?: undefined | number; shardKeys?: string[]; shardingStrategy?: ShardingStrategy; smartJoinAttribute?: undefined | string; statusString: string; validation: ValidationProperties | null; waitForSync: boolean; writeConcern: number }

An object defining the properties of a collection.

CollectionPropertiesOptions

CollectionPropertiesOptions: { journalSize?: undefined | number; validation?: ValidationOptions; waitForSync?: undefined | false | true }

Options for setting a collection's properties.

See Collection.properties.

Type declaration

  • Optional journalSize?: undefined | number

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

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

  • Optional validation?: ValidationOptions

    TODO

  • Optional waitForSync?: undefined | false | true

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

CollectionReadOptions

CollectionReadOptions: { allowDirtyRead?: undefined | false | true; graceful?: undefined | false | true }

TODO

Type declaration

  • Optional allowDirtyRead?: undefined | false | true

    TODO

  • Optional graceful?: undefined | false | true

    TODO

CollectionRemoveOptions

CollectionRemoveOptions: { rSync?: undefined | false | true; returnOld?: undefined | false | true; silent?: undefined | false | true }

TODO

Type declaration

  • Optional rSync?: undefined | false | true

    TODO

  • Optional returnOld?: undefined | false | true

    TODO

  • Optional silent?: undefined | false | true

    TODO

CollectionRemoveResult

CollectionRemoveResult<T>: DocumentMetadata & { old?: T }

TODO

Type parameters

  • T

CollectionReplaceOptions

CollectionReplaceOptions: CollectionSaveOptions & { ignoreRevs?: undefined | false | true }

TODO

CollectionRevision

CollectionRevision: { revision: string }

TODO

Type declaration

  • revision: string

    TODO

CollectionSaveOptions

CollectionSaveOptions: { returnNew?: undefined | false | true; returnOld?: undefined | false | true; silent?: undefined | false | true; waitForSync?: undefined | false | true }

TODO

Type declaration

  • Optional returnNew?: undefined | false | true

    TODO

  • Optional returnOld?: undefined | false | true

    TODO

  • Optional silent?: undefined | false | true

    TODO

  • Optional waitForSync?: undefined | false | true

    TODO

CollectionSaveResult

CollectionSaveResult<T>: CollectionInsertResult<T> & CollectionRemoveResult<T>

TODO

Type parameters

  • T

CollectionUpdateOptions

CollectionUpdateOptions: CollectionReplaceOptions & { keepNull?: undefined | false | true; mergeObjects?: undefined | false | true }

TODO

CreateCollectionOptions

CreateCollectionOptions: { distributeShardsLike?: undefined | string; doCompact?: undefined | false | true; enforceReplicationFactor?: undefined | false | true; indexBuckets?: undefined | number; isSystem?: undefined | false | true; isVolatile?: undefined | false | true; journalSize?: undefined | number; keyOptions?: CollectionKeyOptions; minReplicationFactor?: undefined | number; numberOfShards?: undefined | number; replicationFactor?: undefined | number; shardKeys?: string[]; shardingStrategy?: ShardingStrategy; smartJoinAttribute?: undefined | string; validation?: ValidationOptions; waitForSync?: undefined | false | true; waitForSyncReplication?: undefined | false | true; writeConcern?: undefined | number }

Options for creating a collection.

See Database.createCollection, Database.createEdgeCollection and Collection.create.

Type declaration

  • Optional distributeShardsLike?: undefined | 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?: undefined | false | true

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

    Default: true

  • Optional enforceReplicationFactor?: undefined | false | true

    (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?: undefined | 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

  • Optional isSystem?: undefined | false | true
    internal

    Whether the collection should be created as a system collection.

    Default: false

  • Optional isVolatile?: undefined | false | true

    (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

  • Optional journalSize?: undefined | number

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

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

  • Optional keyOptions?: CollectionKeyOptions

    An object defining the collection's key generation.

  • Optional minReplicationFactor?: undefined | number

    (Cluster only.) Write concern for this collection.

    deprecated

    Renamed to writeConcern in ArangoDB 3.6.

  • Optional numberOfShards?: undefined | number

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

    Default: 1

  • Optional replicationFactor?: undefined | number

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

    Default: 1

  • 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?: undefined | string

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

  • Optional validation?: ValidationOptions

    TODO

  • Optional waitForSync?: undefined | false | true

    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?: undefined | false | true

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

    Default: true

  • Optional writeConcern?: undefined | number

    (Cluster only.) Write concern for this collection.

KeyGenerator

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

The type of key generator.

ShardingStrategy

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

TODO

SimpleQueryAllKeys

SimpleQueryAllKeys: "id" | "key" | "path"

TODO

deprecated

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

SimpleQueryAllOptions

SimpleQueryAllOptions: SimpleQueryByExampleOptions & { stream?: undefined | false | true }

TODO

deprecated

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

SimpleQueryByExampleOptions

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

TODO

deprecated

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

Type declaration

  • Optional batchSize?: undefined | number

    TODO

  • Optional limit?: undefined | number

    TODO

  • Optional skip?: undefined | number

    TODO

  • Optional ttl?: undefined | number

    TODO

SimpleQueryFulltextOptions

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

TODO

deprecated

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

Type declaration

  • Optional index?: undefined | string

    TODO

  • Optional limit?: undefined | number

    TODO

  • Optional skip?: undefined | number

    TODO

SimpleQueryRemoveByExampleOptions

SimpleQueryRemoveByExampleOptions: { limit?: undefined | number; waitForSync?: undefined | false | true }

TODO

deprecated

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

Type declaration

  • Optional limit?: undefined | number

    TODO

  • Optional waitForSync?: undefined | false | true

    TODO

SimpleQueryRemoveByExampleResult

SimpleQueryRemoveByExampleResult: { deleted: number }

TODO

deprecated

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

Type declaration

  • deleted: number

    TODO

SimpleQueryRemoveByKeysOptions

SimpleQueryRemoveByKeysOptions: { returnOld?: undefined | false | true; silent?: undefined | false | true; waitForSync?: undefined | false | true }

TODO

deprecated

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

Type declaration

  • Optional returnOld?: undefined | false | true

    TODO

  • Optional silent?: undefined | false | true

    TODO

  • Optional waitForSync?: undefined | false | true

    TODO

SimpleQueryRemoveByKeysResult

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

TODO

deprecated

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

Type parameters

  • T: object

Type declaration

SimpleQueryReplaceByExampleOptions

SimpleQueryReplaceByExampleOptions: SimpleQueryRemoveByExampleOptions

TODO

deprecated

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

SimpleQueryReplaceByExampleResult

SimpleQueryReplaceByExampleResult: { replaced: number }

TODO

deprecated

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

Type declaration

  • replaced: number

    TODO

SimpleQueryUpdateByExampleOptions

SimpleQueryUpdateByExampleOptions: { keepNull?: undefined | false | true; limit?: undefined | number; mergeObjects?: undefined | false | true; waitForSync?: undefined | false | true }

TODO

deprecated

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

Type declaration

  • Optional keepNull?: undefined | false | true

    TODO

  • Optional limit?: undefined | number

    TODO

  • Optional mergeObjects?: undefined | false | true

    TODO

  • Optional waitForSync?: undefined | false | true

    TODO

SimpleQueryUpdateByExampleResult

SimpleQueryUpdateByExampleResult: { updated: number }

TODO

deprecated

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

Type declaration

  • updated: number

    TODO

TraversalOptions

TraversalOptions: { direction?: "inbound" | "outbound" | "any"; expander?: undefined | string; filter?: undefined | string; init?: undefined | string; itemOrder?: "forward" | "backward"; maxDepth?: undefined | number; maxIterations?: undefined | number; minDepth?: undefined | number; order?: "preorder" | "postorder" | "preorder-expander"; sort?: undefined | string; strategy?: "depthfirst" | "breadthfirst"; uniqueness?: undefined | { edges?: "none" | "global" | "path"; vertices?: "none" | "global" | "path" }; visitor?: undefined | string }

TODO

deprecated

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

Type declaration

  • Optional direction?: "inbound" | "outbound" | "any"

    TODO

  • Optional expander?: undefined | string

    TODO

  • Optional filter?: undefined | string

    TODO

  • Optional init?: undefined | string

    TODO

  • Optional itemOrder?: "forward" | "backward"

    TODO

  • Optional maxDepth?: undefined | number

    TODO

  • Optional maxIterations?: undefined | number

    TODO

  • Optional minDepth?: undefined | number

    TODO

  • Optional order?: "preorder" | "postorder" | "preorder-expander"

    TODO

  • Optional sort?: undefined | string

    TODO

  • Optional strategy?: "depthfirst" | "breadthfirst"

    TODO

  • Optional uniqueness?: undefined | { edges?: "none" | "global" | "path"; vertices?: "none" | "global" | "path" }

    TODO

  • Optional visitor?: undefined | string

    TODO

ValidationLevel

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

TODO

ValidationOptions

ValidationOptions: { level?: ValidationLevel; message?: undefined | string; rule: any }

TODO

Type declaration

  • Optional level?: ValidationLevel

    TODO

  • Optional message?: undefined | string

    TODO

  • rule: any

    TODO

ValidationProperties

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

TODO

Type declaration

  • level: ValidationLevel

    TODO

  • message: string

    TODO

  • rule: any

    TODO

  • type: "json"

    TODO

Functions

isArangoCollection

  • isArangoCollection(collection: any): collection is ArangoCollection
  • 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