UNPKG

arangojs

Version:

The official ArangoDB JavaScript driver.

1 lines 108 kB
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/collection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAwB,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG1E,OAAO,EASL,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAaL,YAAY,GAEb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAe;IAEf,OAAO,OAAO,CAAC,UAAU,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAqC;IAErC,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;;QAAM,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC;AAqBD;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iFAAuB,CAAA;IACvB,yEAAmB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,6DAAW,CAAA;IACX,+DAAY,CAAA;IACZ,2DAAU,CAAA;IACV,iEAAa,CAAA;IACb,6DAAW,CAAA;IACX,6DAAW,CAAA;AACb,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B;AAohFD;;GAEG;AACH,MAAM,OAAO,UAAU;IAQrB,oBAAoB;IACV,KAAK,CAAS;IACd,GAAG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AAC;IACJ,CAAC;CAEF","sourcesContent":["/**\n * ```ts\n * import type {\n * DocumentCollection,\n * EdgeCollection,\n * } from \"arangojs/collection.js\";\n * ```\n *\n * The \"collection\" module provides collection related types and interfaces\n * for TypeScript.\n *\n * @packageDocumentation\n */\nimport { AqlLiteral, AqlQuery, isAqlLiteral, isAqlQuery } from \"./aql.js\";\nimport { ArangoApiResponse } from \"./connection.js\";\nimport { Database } from \"./database.js\";\nimport {\n Document,\n DocumentData,\n DocumentMetadata,\n DocumentSelector,\n Edge,\n EdgeData,\n ObjectWithKey,\n Patch,\n _documentHandle,\n} from \"./documents.js\";\nimport { HttpError, isArangoError } from \"./error.js\";\nimport {\n EnsureGeoIndexOptions,\n EnsureInvertedIndexOptions,\n EnsurePersistentIndexOptions,\n EnsureTtlIndexOptions,\n EnsureMdiIndexOptions,\n GeoIndex,\n Index,\n IndexSelector,\n InvertedIndex,\n PersistentIndex,\n TtlIndex,\n MdiIndex,\n _indexHandle,\n EnsureIndexOptions,\n} from \"./indexes.js\";\nimport { COLLECTION_NOT_FOUND, DOCUMENT_NOT_FOUND } from \"./lib/codes.js\";\n\n/**\n * Indicates whether the given value represents an {@link ArangoCollection}.\n *\n * @param collection - A value that might be a collection.\n */\nexport function isArangoCollection(\n collection: any\n): collection is ArangoCollection {\n return Boolean(collection && collection.isArangoCollection);\n}\n\n/**\n * Coerces the given collection name or {@link ArangoCollection} object to\n * a string representing the collection name.\n *\n * @param collection - Collection name or {@link ArangoCollection} object.\n */\nexport function collectionToString(\n collection: string | ArangoCollection\n): string {\n if (isArangoCollection(collection)) {\n return String(collection.name);\n } else return String(collection);\n}\n\n/**\n * A marker interface identifying objects that can be used in AQL template\n * strings to create references to ArangoDB collections.\n *\n * See {@link aql!aql}.\n */\nexport interface ArangoCollection {\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB collection.\n */\n readonly isArangoCollection: true;\n /**\n * Name of the collection.\n */\n readonly name: string;\n}\n\n/**\n * Integer values indicating the collection type.\n */\nexport enum CollectionType {\n DOCUMENT_COLLECTION = 2,\n EDGE_COLLECTION = 3,\n}\n\n/**\n * Integer values indicating the collection loading status.\n */\nexport enum CollectionStatus {\n NEWBORN = 1,\n UNLOADED = 2,\n LOADED = 3,\n UNLOADING = 4,\n DELETED = 5,\n LOADING = 6,\n}\n\n/**\n * Type of key generator.\n */\nexport type KeyGenerator = \"traditional\" | \"autoincrement\" | \"uuid\" | \"padded\";\n\n/**\n * Strategy for sharding a collection.\n */\nexport type ShardingStrategy =\n | \"hash\"\n | \"enterprise-hash-smart-edge\"\n | \"enterprise-hash-smart-vertex\"\n | \"community-compat\"\n | \"enterprise-compat\"\n | \"enterprise-smart-edge-compat\";\n\n/**\n * When a validation should be applied.\n *\n * * `\"none\"`: No validation.\n * * `\"new\"`: Newly inserted documents are validated.\n * * `\"moderate\"`: New and modified documents are validated unless the modified\n * document was already invalid.\n * * `\"strict\"`: New and modified documents are always validated.\n */\nexport type ValidationLevel = \"none\" | \"new\" | \"moderate\" | \"strict\";\n\n/**\n * Write operation that can result in a computed value being computed.\n */\nexport type WriteOperation = \"insert\" | \"update\" | \"replace\";\n\n/**\n * Represents a bulk operation failure for an individual document.\n */\nexport type DocumentOperationFailure = {\n /**\n * Indicates that the operation failed.\n */\n error: true;\n /**\n * Human-readable description of the failure.\n */\n errorMessage: string;\n /**\n * Numeric representation of the failure.\n */\n errorNum: number;\n};\n\n/**\n * Metadata returned by a document operation.\n */\nexport type DocumentOperationMetadata = DocumentMetadata & {\n /**\n * Revision of the document that was updated or replaced by this operation.\n */\n _oldRev?: string;\n};\n\n/**\n * Properties defining a computed value.\n */\nexport type ComputedValueProperties = {\n /**\n * Name of the target attribute of the computed value.\n */\n name: string;\n /**\n * AQL `RETURN` expression that computes the value.\n */\n expression: string;\n /**\n * If set to `false`, the computed value will not be applied if the\n * expression evaluates to `null`.\n */\n overwrite: boolean;\n /**\n * Which operations should result in the value being computed.\n */\n computeOn: WriteOperation[];\n /**\n * If set to `false`, the field will be unset if the expression evaluates to\n * `null`. Otherwise the field will be set to the value `null`. Has no effect\n * if `overwrite` is set to `false`.\n */\n keepNull: boolean;\n /**\n * Whether the write operation should fail if the expression produces a\n * warning.\n */\n failOnWarning: boolean;\n};\n\n/**\n * General information about a collection.\n */\nexport type CollectionMetadata = {\n /**\n * Collection name.\n */\n name: string;\n /**\n * A globally unique identifier for this collection.\n */\n globallyUniqueId: string;\n /**\n * An integer indicating the collection loading status.\n */\n status: CollectionStatus;\n /**\n * An integer indicating the collection type.\n */\n type: CollectionType;\n /**\n * @internal\n *\n * Whether the collection is a system collection.\n */\n isSystem: boolean;\n};\n\n/**\n * An object defining the collection's key generation.\n */\nexport type CollectionKeyProperties = {\n /**\n * Type of key generator to use.\n */\n type: KeyGenerator;\n /**\n * Whether documents can be created with a user-specified `_key` attribute.\n */\n allowUserKeys: boolean;\n /**\n * (Autoincrement only.) How many steps to increment the key each time.\n */\n increment?: number;\n /**\n * (Autoincrement only.) Initial offset for the key.\n */\n offset?: number;\n /**\n * Most recent key that has been generated.\n */\n lastValue: number;\n};\n\n/**\n * Properties for validating documents in a collection.\n */\nexport type SchemaProperties = {\n /**\n * Type of document validation.\n */\n type: \"json\";\n /**\n * JSON Schema description of the validation schema for documents.\n */\n rule: any;\n /**\n * When validation should be applied.\n */\n level: ValidationLevel;\n /**\n * Message to be used if validation fails.\n */\n message: string;\n};\n\n/**\n * An object defining the properties of a collection.\n */\nexport type CollectionProperties = {\n /**\n * A human-readable representation of the collection loading status.\n */\n statusString: string;\n /**\n * Whether data should be synchronized to disk before returning from\n * a document create, update, replace or removal operation.\n */\n waitForSync: boolean;\n /**\n * An object defining the collection's key generation.\n */\n keyOptions: CollectionKeyProperties;\n /**\n * Properties for validating documents in the collection.\n */\n schema: SchemaProperties | null;\n /**\n * (Cluster only.) Write concern for this collection.\n */\n writeConcern: number;\n /**\n * (Cluster only.) Number of shards of this collection.\n */\n numberOfShards?: number;\n /**\n * (Cluster only.) Keys of this collection that will be used for\n * sharding.\n */\n shardKeys?: string[];\n /**\n * (Cluster only.) Replication factor of the collection.\n */\n replicationFactor?: number | \"satellite\";\n /**\n * (Cluster only.) Sharding strategy of the collection.\n */\n shardingStrategy?: ShardingStrategy;\n /**\n * (Enterprise Edition cluster only.) If set to a collection name, sharding\n * of the new collection will follow the rules for that collection. As long\n * as the new collection exists, the indicated collection can not be dropped.\n */\n distributeShardsLike?: string;\n /**\n * (Enterprise Edition cluster only.) Attribute containing the shard key\n * value of the referred-to smart join collection.\n */\n smartJoinAttribute?: string;\n /**\n * (Enterprise Edition cluster only.) Attribute used for sharding.\n */\n smartGraphAttribute?: string;\n /**\n * Computed values applied to documents in this collection.\n */\n computedValues: ComputedValueProperties[];\n /**\n * Whether the in-memory hash cache is enabled for this collection.\n */\n cacheEnabled: boolean;\n /**\n * Whether the newer revision-based replication protocol is enabled for\n * this collection.\n */\n syncByRevision: boolean;\n /**\n * (Enterprise Edition only.) Whether the collection is used in a SmartGraph or EnterpriseGraph.\n */\n isSmart?: boolean;\n /**\n * (Enterprise Edition only.) Whether the SmartGraph this collection belongs to is disjoint.\n */\n isDisjoint?: string;\n};\n\n// Options\n\n/**\n * Options for creating a computed value.\n */\nexport type ComputedValueOptions = {\n /**\n * Name of the target attribute of the computed value.\n */\n name: string;\n /**\n * AQL `RETURN` expression that computes the value.\n *\n * Note that when passing an AQL query object, the `bindVars` will be ignored.\n */\n expression: string | AqlLiteral | AqlQuery;\n /**\n * If set to `false`, the computed value will not be applied if the\n * expression evaluates to `null`.\n *\n * Default: `true`\n */\n overwrite?: boolean;\n /**\n * Which operations should result in the value being computed.\n *\n * Default: `[\"insert\", \"update\", \"replace\"]`\n */\n computeOn?: WriteOperation[];\n /**\n * If set to `false`, the field will be unset if the expression evaluates to\n * `null`. Otherwise the field will be set to the value `null`. Has no effect\n * if `overwrite` is set to `false`.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * Whether the write operation should fail if the expression produces a\n * warning.\n *\n * Default: `false`\n */\n failOnWarning?: boolean;\n};\n\n/**\n * Options for validating collection documents.\n */\nexport type SchemaOptions = {\n /**\n * JSON Schema description of the validation schema for documents.\n */\n rule: any;\n /**\n * When validation should be applied.\n *\n * Default: `\"strict\"`\n */\n level?: ValidationLevel;\n /**\n * Message to be used if validation fails.\n */\n message?: string;\n};\n\n/**\n * Options for setting a collection's properties.\n *\n * See {@link DocumentCollection#properties} and {@link EdgeCollection#properties}.\n */\nexport type CollectionPropertiesOptions = {\n /**\n * Whether data should be synchronized to disk before returning from\n * a document create, update, replace or removal operation.\n */\n waitForSync?: boolean;\n /**\n * (Cluster only.) How many copies of each document should be kept in the\n * cluster.\n *\n * Default: `1`\n */\n replicationFactor?: number | \"satellite\";\n /**\n * (Cluster only.) Write concern for this collection.\n */\n writeConcern?: number;\n /**\n * Options for validating documents in this collection.\n */\n schema?: SchemaOptions;\n /**\n * Computed values to apply to documents in this collection.\n */\n computedValues?: ComputedValueOptions[];\n /**\n * Whether the in-memory hash cache is enabled for this collection.\n *\n * Default: `false`\n */\n cacheEnabled?: boolean;\n};\n\n/**\n * Options for retrieving a collection checksum.\n */\nexport type CollectionChecksumOptions = {\n /**\n * If set to `true`, revision IDs will be included in the calculation\n * of the checksum.\n *\n * Default: `false`\n */\n withRevisions?: boolean;\n /**\n * If set to `true`, document data will be included in the calculation\n * of the checksum.\n *\n * Default: `false`\n */\n withData?: boolean;\n};\n\n/**\n * Options for dropping collections.\n */\nexport type CollectionDropOptions = {\n /**\n * Whether the collection is a system collection. If the collection is a\n * system collection, this option must be set to `true` or ArangoDB will\n * refuse to drop the collection.\n *\n * Default: `false`\n */\n isSystem?: boolean;\n};\n\n/**\n * An object defining the collection's key generation.\n */\nexport type CollectionKeyOptions = {\n /**\n * Type of key generator to use.\n */\n type?: KeyGenerator;\n /**\n * Unless set to `false`, documents can be created with a user-specified\n * `_key` attribute.\n *\n * Default: `true`\n */\n allowUserKeys?: boolean;\n /**\n * (Autoincrement only.) How many steps to increment the key each time.\n */\n increment?: number;\n /**\n * (Autoincrement only.) Initial offset for the key.\n */\n offset?: number;\n};\n\n/**\n * Options for creating a collection.\n *\n * See {@link database.Database#createCollection}, {@link database.Database#createEdgeCollection}\n * and {@link DocumentCollection#create} or {@link EdgeCollection#create}.\n */\nexport type CreateCollectionOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning from\n * a document create, update, replace or removal operation.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * @internal\n *\n * Whether the collection should be created as a system collection.\n *\n * Default: `false`\n */\n isSystem?: boolean;\n /**\n * An object defining the collection's key generation.\n */\n keyOptions?: CollectionKeyOptions;\n /**\n * Options for validating documents in the collection.\n */\n schema?: SchemaOptions;\n /**\n * (Cluster only.) Unless set to `false`, the server will wait for all\n * replicas to create the collection before returning.\n *\n * Default: `true`\n */\n waitForSyncReplication?: boolean;\n /**\n * (Cluster only.) Unless set to `false`, the server will check whether\n * enough replicas are available at creation time and bail out otherwise.\n *\n * Default: `true`\n */\n enforceReplicationFactor?: boolean;\n /**\n * (Cluster only.) Number of shards to distribute the collection across.\n *\n * Default: `1`\n */\n numberOfShards?: number;\n /**\n * (Cluster only.) Document attributes to use to determine the target shard\n * for each document.\n *\n * Default: `[\"_key\"]`\n */\n shardKeys?: string[];\n /**\n * (Cluster only.) How many copies of each document should be kept in the\n * cluster.\n *\n * Default: `1`\n */\n replicationFactor?: number;\n /**\n * (Cluster only.) Write concern for this collection.\n */\n writeConcern?: number;\n /**\n * (Cluster only.) Sharding strategy to use.\n */\n shardingStrategy?: ShardingStrategy;\n /**\n * (Enterprise Edition cluster only.) If set to a collection name, sharding\n * of the new collection will follow the rules for that collection. As long\n * as the new collection exists, the indicated collection can not be dropped.\n */\n distributeShardsLike?: string;\n /**\n * (Enterprise Edition cluster only.) Attribute containing the shard key\n * value of the referred-to smart join collection.\n */\n smartJoinAttribute?: string;\n /**\n * (Enterprise Edition cluster only.) Attribute used for sharding.\n */\n smartGraphAttribute?: string;\n /**\n * Computed values to apply to documents in this collection.\n */\n computedValues?: ComputedValueOptions[];\n /**\n * Whether the in-memory hash cache is enabled for this collection.\n */\n cacheEnabled?: boolean;\n};\n\n/**\n * Options for checking whether a document exists in a collection.\n */\nexport type DocumentExistsOptions = {\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * does not match the given revision.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving a document from a collection.\n */\nexport type CollectionReadOptions = {\n /**\n * If set to `true`, `null` is returned instead of an exception being thrown\n * if the document does not exist.\n */\n graceful?: boolean;\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists but its `_rev` does not match the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists and its `_rev` matches the given revision. Note that an\n * `HttpError` with code 304 will be thrown instead of an `ArangoError`.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving multiple documents from a collection.\n */\nexport type CollectionBatchReadOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n};\n\n/**\n * Options for inserting a new document into a collection.\n */\nexport type CollectionInsertOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n * This option is only available when `overwriteMode` is set to `\"update\"` or\n * `\"replace\"`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * Defines what should happen if a document with the same `_key` or `_id`\n * already exists, instead of throwing an exception.\n *\n * Default: `\"conflict\"\n */\n overwriteMode?: \"ignore\" | \"update\" | \"replace\" | \"conflict\";\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged when an existing document\n * with the same `_key` or `_id` is updated. This does not affect arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to `true`, new entries will be added to in-memory index caches if\n * document insertions affect the edge index or cache-enabled persistent\n * indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for replacing an existing document in a collection.\n */\nexport type CollectionReplaceOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to a document revision, the document will only be replaced if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document replacements affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for updating a document in a collection.\n */\nexport type CollectionUpdateOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged. This does not affect\n * arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to a document revision, the document will only be updated if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document updates affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for removing a document from a collection.\n */\nexport type CollectionRemoveOptions = {\n /**\n * If set to `true`, changes will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to a document revision, the document will only be removed if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * deleted if document removals affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n};\n\n/**\n * Options for bulk importing documents into a collection.\n */\nexport type CollectionImportOptions = {\n /**\n * (Edge collections only.) Prefix to prepend to `_from` attribute values.\n */\n fromPrefix?: string;\n /**\n * (Edge collections only.) Prefix to prepend to `_to` attribute values.\n */\n toPrefix?: string;\n /**\n * If set to `true`, the collection is truncated before the data is imported.\n *\n * Default: `false`\n */\n overwrite?: boolean;\n /**\n * Whether to wait for the documents to have been synced to disk.\n */\n waitForSync?: boolean;\n /**\n * Controls behavior when a unique constraint is violated on the document key.\n *\n * * `\"error\"`: the document will not be imported.\n * * `\"update`: the document will be merged into the existing document.\n * * `\"replace\"`: the document will replace the existing document.\n * * `\"ignore\"`: the document will not be imported and the unique constraint\n * error will be ignored.\n *\n * Default: `\"error\"`\n */\n onDuplicate?: \"error\" | \"update\" | \"replace\" | \"ignore\";\n /**\n * If set to `true`, the import will abort if any error occurs.\n */\n complete?: boolean;\n /**\n * Whether the response should contain additional details about documents\n * that could not be imported.\n */\n details?: boolean;\n};\n\n/**\n * Options for retrieving a document's edges from a collection.\n */\nexport type CollectionEdgesOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n};\n\nexport type IndexListOptions = {\n /**\n * If set to `true`, includes additional information about each index.\n *\n * Default: `false`\n */\n withStats?: boolean;\n /**\n * If set to `true`, includes indexes that are not yet fully built but are\n * in the building phase.\n *\n * Default: `false`.\n */\n withHidden?: boolean;\n};\n\n// Results\n\n/**\n * Result of a collection bulk import.\n */\nexport type CollectionImportResult = {\n /**\n * Whether the import failed.\n */\n error: false;\n /**\n * Number of new documents imported.\n */\n created: number;\n /**\n * Number of documents that failed with an error.\n */\n errors: number;\n /**\n * Number of empty documents.\n */\n empty: number;\n /**\n * Number of documents updated.\n */\n updated: number;\n /**\n * Number of documents that failed with an error that is ignored.\n */\n ignored: number;\n /**\n * Additional details about any errors encountered during the import.\n */\n details?: string[];\n};\n\n/**\n * Result of retrieving edges in a collection.\n */\nexport type CollectionEdgesResult<T extends Record<string, any> = any> = {\n edges: Edge<T>[];\n stats: {\n scannedIndex: number;\n filtered: number;\n };\n};\n\n// Collections\n\n/**\n * Represents an document collection in a {@link database.Database}.\n *\n * See {@link EdgeCollection} for a variant of this interface more suited for\n * edge collections.\n *\n * When using TypeScript, collections can be cast to a specific document data\n * type to increase type safety.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n *\n * @example\n * ```ts\n * interface Person {\n * name: string;\n * }\n * const db = new Database();\n * const documents = db.collection(\"persons\") as DocumentCollection<Person>;\n * ```\n */\nexport interface DocumentCollection<\n EntryResultType extends Record<string, any> = any,\n EntryInputType extends Record<string, any> = EntryResultType,\n> extends ArangoCollection {\n /**\n * Checks whether the collection exists.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const result = await collection.exists();\n * // result indicates whether the collection exists\n * ```\n */\n exists(): Promise<boolean>;\n /**\n * Retrieves general information about the collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const data = await collection.get();\n * // data contains general information about the collection\n * ```\n */\n get(): Promise<ArangoApiResponse<CollectionMetadata>>;\n /**\n * Creates a collection with the given `options` and the instance's name.\n *\n * See also {@link database.Database#createCollection} and\n * {@link database.Database#createEdgeCollection}.\n *\n * **Note**: When called on an {@link EdgeCollection} instance in TypeScript,\n * the `type` option must still be set to the correct {@link CollectionType}.\n * Otherwise this will result in the collection being created with the\n * default type (i.e. as a document collection).\n *\n * @param options - Options for creating the collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"potatoes\");\n * await collection.create();\n * // the document collection \"potatoes\" now exists\n * ```\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * await collection.create({ type: CollectionType.EDGE_COLLECTION });\n * // the edge collection \"friends\" now exists\n * ```\n *\n * @example\n * ```ts\n * interface Friend {\n * startDate: number;\n * endDate?: number;\n * }\n * const db = new Database();\n * const collection = db.collection(\"friends\") as EdgeCollection<Friend>;\n * // even in TypeScript you still need to indicate the collection type\n * // if you want to create an edge collection\n * await collection.create({ type: CollectionType.EDGE_COLLECTION });\n * // the edge collection \"friends\" now exists\n * ```\n */\n create(\n options?: CreateCollectionOptions & {\n type?: CollectionType;\n }\n ): Promise<ArangoApiResponse<CollectionMetadata & CollectionProperties>>;\n /**\n * Retrieves the collection's properties.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const data = await collection.properties();\n * // data contains the collection's properties\n * ```\n */\n properties(): Promise<\n ArangoApiResponse<CollectionMetadata & CollectionProperties>\n >;\n /**\n * Replaces the properties of the collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const result = await collection.setProperties({ waitForSync: true });\n * // the collection will now wait for data being written to disk\n * // whenever a document is changed\n * ```\n */\n properties(\n properties: CollectionPropertiesOptions\n ): Promise<ArangoApiResponse<CollectionMetadata & CollectionProperties>>;\n /**\n * Retrieves information about the number of documents in a collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const data = await collection.count();\n * // data contains the collection's count\n * ```\n */\n count(): Promise<\n ArangoApiResponse<\n CollectionMetadata & CollectionProperties & { count: number }\n >\n >;\n /**\n * Instructs ArangoDB to recalculate the collection's document count to fix\n * any inconsistencies.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"inconsistent-collection\");\n * const badData = await collection.count();\n * // oh no, the collection count looks wrong -- fix it!\n * await collection.recalculateCount();\n * const goodData = await collection.count();\n * // goodData contains the collection's improved count\n * ```\n */\n recalculateCount(): Promise<boolean>;\n /**\n * Retrieves statistics for a collection.\n *\n * @param details - whether to return extended storage engine-specific details\n * to the figures, which may cause additional load and impact performance\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const data = await collection.figures();\n * // data contains the collection's figures\n * ```\n */\n figures(\n details?: boolean\n ): Promise<\n ArangoApiResponse<\n CollectionMetadata &\n CollectionProperties & { count: number; figures: Record<string, any> }\n >\n >;\n /**\n * Retrieves the collection revision ID.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const data = await collection.revision();\n * // data contains the collection's revision\n * ```\n */\n revision(): Promise<\n ArangoApiResponse<\n CollectionMetadata & CollectionProperties & { revision: string }\n >\n >;\n /**\n * Retrieves the collection checksum.\n *\n * @param options - Options for retrieving the checksum.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const data = await collection.checksum();\n * // data contains the collection's checksum\n * ```\n */\n checksum(\n options?: CollectionChecksumOptions\n ): Promise<\n ArangoApiResponse<\n CollectionMetadata & { revision: string; checksum: string }\n >\n >;\n /**\n * Instructs ArangoDB to load as many indexes of the collection into memory\n * as permitted by the memory limit.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"indexed-collection\");\n * await collection.loadIndexes();\n * // the indexes are now loaded into memory\n * ```\n */\n loadIndexes(): Promise<boolean>;\n /**\n * Renames the collection and updates the instance's `name` to `newName`.\n *\n * Additionally removes the instance from the {@link database.Database}'s internal\n * cache.\n *\n * **Note**: Renaming collections may not be supported when ArangoDB is\n * running in a cluster configuration.\n *\n * @param newName - The new name of the collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection1 = db.collection(\"some-collection\");\n * await collection1.rename(\"other-collection\");\n * const collection2 = db.collection(\"some-collection\");\n * const collection3 = db.collection(\"other-collection\");\n * // Note all three collection instances are different objects but\n * // collection1 and collection3 represent the same ArangoDB collection!\n * ```\n */\n rename(newName: string): Promise<ArangoApiResponse<CollectionMetadata>>;\n /**\n * Deletes all documents in the collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * await collection.truncate();\n * // millions of documents cry out in terror and are suddenly silenced,\n * // the collection \"some-collection\" is now empty\n * ```\n */\n truncate(): Promise<ArangoApiResponse<CollectionMetadata>>;\n /**\n * Deletes the collection from the database.\n *\n * @param options - Options for dropping the collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * await collection.drop();\n * // The collection \"some-collection\" is now an ex-collection\n * ```\n */\n drop(\n options?: CollectionDropOptions\n ): Promise<ArangoApiResponse<Record<string, never>>>;\n\n //#region crud\n /**\n * Retrieves the `shardId` of the shard responsible for the given document.\n *\n * @param document - Document in the collection to look up the `shardId` of.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"some-collection\");\n * const responsibleShard = await collection.getResponsibleShard();\n * ```\n */\n getResponsibleShard(\n document: Partial<Document<EntryResultType>>\n ): Promise<string>;\