Skip to content

Releases: arangodb/arangojs

v10.2.2

30 Jan 12:21

Choose a tag to compare

Fixed

  • Fixed "Fetch failed: Invalid URL" error when using agentOptions by ensuring request creation
    consistently uses undici.Request together with undici.fetch when the undici-based
    dispatcher is active. This avoids invalid URL errors caused by mixing globalThis.Request
    with undici request implementations.

v10.2.1

23 Jan 06:27

Choose a tag to compare

Fixed

  • Fixed a JSON Parse error: Unexpected EOF occurring in the Bun runtime when using
    documentExists, vertexExists, or edgeExists. The driver now correctly skips
    response body parsing for HEAD requests, which must not include a body per RFC 7231.
    This fix also applies to all HEAD requests made via Route.head(), ensuring consistent
    behavior and compatibility across all fetch implementations.
    (#821)

  • Fixed ECONNRESET errors in NextJS 15 production builds when using next/cookies
    by explicitly setting the Content-Length header for all fixed-size request bodies.
    The driver now calculates and sets Content-Length for strings (JSON and plain text),
    Blobs, Buffers, FormData, and empty bodies, ensuring compatibility with NextJS 15
    dynamic routes and other environments that don't automatically set this header.
    (#831)

v10.2.0

16 Jan 10:41

Choose a tag to compare

Fixed

  • Fixed agentOptions not being passed to createHost function, preventing
    configuration of undici agent for self-signed certificates and other TLS options.
    The agentOptions parameter is now properly extracted from configuration and
    passed to all host creation calls. (#824)

Added

  • Added maxSkewThreshold and minDeletionRatio options to TierConsolidationPolicy type (DE-1094)

    These options are available from ArangoDB 3.12.7 onward and can be used for both arangosearch Views and inverted indexes.

  • Added storedValues option for vector indexes (DE-1098)

    Vector indexes now support storing additional attributes for efficient filtering.
    This option is available in ArangoDB 3.12.7+.

  • Added innerProduct metric support for vector indexes

    Vector indexes now support the innerProduct metric, which was introduced in
    ArangoDB 3.12.6. This metric compares both angle and magnitude without normalization,
    making it faster than cosine similarity.

  • Added access token support (DE-1106)

    Access tokens can be used as password replacements for authentication. This
    feature enables better automation, CI/CD integration, and fine-grained access
    control.

    • Added db.createAccessToken(username, options) method to create access
      tokens for users
    • Added db.getAccessTokens(username) method to list all access tokens for
      a user (metadata only)
    • Added db.deleteAccessToken(username, tokenId) method to revoke access
      tokens
    • Added db.useAccessToken(token) convenience method for Basic Auth
      authentication with tokens
    • Added TypeScript types: CreateAccessTokenOptions, AccessToken,
      AccessTokenMetadata, and AccessTokenListResponse

    Access tokens can be used with:

    • Basic Authentication: db.useAccessToken(token) or
      db.useBasicAuth("", token)
    • JWT exchange: db.login("", token) or db.login(username, token)

    Note: The valid_until option accepts only Unix timestamps (numbers in
    seconds), not Date objects. Users must convert Date objects themselves:
    Math.floor(date.getTime() / 1000).

Deprecated

  • Deprecated consolidation policy options in TierConsolidationPolicy that are ignored by ArangoDB 3.12.7+ (DE-1094)

    The following options are ignored by the server from v3.12.7 onwards: segmentsMin, segmentsMax, segmentsBytesFloor and minScore. These fields remain in the type definition for backward compatibility but are marked as deprecated.

v10.1.2

02 Jul 15:15
fe2ff4b

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v10.1.1...v10.1.2

v10.1.1

13 Jan 10:06
c13259a

Choose a tag to compare

Changed

  • Removed File from source option types in Foxx CRUD methods (#818)

    The source option type already includes Blob, which File extends.

v10.1.0

13 Jan 09:48
6ded453

Choose a tag to compare

Added

  • Added ignoreRevs option to RemoveDocumentOptions type (DE-947)

    This affects the collection.remove and collection.removeAll methods.

v10.0.0

06 Jan 18:46
dec0293

Choose a tag to compare

This is a major release and breaks backwards compatibility.

See the migration guide for detailed instructions
for upgrading your code to arangojs v10.

Removed

  • Removed unused CreateUserOptions type

    The actual type used by the db.createUser method is still UserOptions.

  • Removed unused IndexDetails type

    This type was intended to be returned by collection.indexes when the
    withStats option is set to true but the figures property is already
    included in the current return type.

  • Removed Node.js 18 support

    Node.js 18 will reach its end of life in May 2025, so arangojs will no
    longer support this version of Node.js going forward.

    For more information, see the Node.js release schedule.

Changed

  • Closing a connection now closes all open requests

    Previously in certain situations only the most recent request would be
    closed per server. Note that this still merely aborts the requests but
    does not guarantee the underlying connections are closed as these are
    handled by Node.js or the browser natively. need to be installed
    otherwise.

  • Moved fetch-specific config options from into config.fetchOptions

    The following options were moved: credentials, headers and keepalive.

  • db.setUserAccessLevel now takes grant as a separate parameter

    The parameter was previously passed as an additional property in the
    options parameter.

Error handling

  • Errors encountered before a request completes are now wrapped in a
    NetworkError or a subclass thereof

    This should help making it easier to diagnose network issues and distinguish
    the relevant error conditions.

    The originating error can still be accessed using the cause property of the
    NetworkError error.

  • HttpError now extends the NetworkError class

    This allows treating all non-ArangoError errors as one category of errors,
    even when there is no server response available.

  • db.waitForPropagation now throws a PropagationTimeoutError error when
    invoked with a timeout option and the timeout duration is exceeded

    The method would previously throw the most recent error encountered while
    waiting for replication. The originating error can still be accessed using
    the cause property of the PropagationTimeoutError error.

  • db.waitForPropagation now respects the timeout option more strictly

    Previously the method would only time out if the timeout duration was
    exceeded after the most recent request failed. Now the timeout is
    recalculated and passed on to each request, preventing it from exceeding
    the specified duration.

    If the propagation timed out due to an underlying request exceeding the
    timeout duration, the cause property of the PropagationTimeoutError
    error will be a ResponseTimeoutError error.

  • config.beforeRequest and config.afterResponse callbacks can now return
    promises

    If the callback returns a promise, it will be awaited before the request
    and response cycle proceeds. If either callback throws an error or returns
    a promise that is rejected, that error will be thrown instead.

  • config.afterResponse callback signature changed

    The callback signature previously used the internal ArangojsResponse type.
    The new signature uses the Response type of the Fetch API with an
    additional request property to more accurately represent the actual value
    it receives as the parsedBody property will never be present.

  • response property on ArangoError is now optional

    This property should always be present but this allows using the error in
    situations where a response might not be available.

General type changes

  • Changed GraphVertexCollection and GraphEdgeCollection generic types to
    take separate EntryResultType and EntryInputType type parameters

  • Changed db.collection, db.createCollection and db.createEdgeCollection
    methods to take separate EntryResultType and EntryInputType type
    parameters

    These type parameters are used to narrow the the returned collection type.

  • Changed db.removeUser method return type to Promise<void>

    The previous return type served no purpose.

  • Changed QueueTimeMetrics type to an interface

  • Changed CursorExtras and CursorStats interfaces to types

Low-level request/route changes

  • Renamed path option to pathname in RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Removed basePath option from RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Renamed route.path property to route.pathname

Renamed methods

  • Renamed various methods for consistency:

    Methods that return an array now follow the listNouns pattern, methods that
    return a "list of nouns" wrapped in an object have been renamed to follow the
    getNouns pattern to avoid confusion:

    • db.listServiceScripts -> db.getServiceScripts
    • db.listHotBackups -> db.getHotBackups
    • db.listFunctions -> db.listUserFunctions
    • db.getLogMessages -> db.listLogMessages
  • Renamed AQL user function management methods:

    • db.createFunction -> db.createUserFunction
    • db.dropFunction -> db.dropUserFunction

Module renaming

  • Renamed most modules to plural form for consistency

    The following modules were renamed:

    • arangojs/analyzer -> arangojs/analyzers
    • arangojs/collection -> arangojs/collections
    • arangojs/cursor -> arangojs/cursors
    • arangojs/database -> arangojs/databases
    • arangojs/error -> arangojs/errors
    • arangojs/graph -> arangojs/graphs
    • arangojs/job -> arangojs/jobs
    • arangojs/route -> arangojs/routes
    • arangojs/transaction -> arangojs/transactions
    • arangojs/view -> arangojs/views
  • Moved internal utility functions to new arangojs/lib/util module

    These methods are all still marked as internal and should not be used
    directly.

Moved types

  • Moved document related types from arangojs/collection module to
    arangojs/documents module

    The following types were moved: DocumentOperationFailure,
    DocumentOperationMetadata, DocumentExistsOptions,
    CollectionReadOptions, CollectionBatchReadOptions,
    CollectionInsertOptions, CollectionReplaceOptions,
    CollectionUpdateOptions, CollectionRemoveOptions,
    CollectionImportOptions, CollectionEdgesOptions,
    CollectionImportResult and CollectionEdgesResult

  • Moved index related types from arangojs/collection module to
    arangojs/indexes module

    The following types were moved: IndexListOptions.

  • Moved transaction related types from arangojs/database module to
    arangojs/transactions module

    The following types were moved: TransactionCollections,
    TransactionOptions and TransactionDetails.

  • Moved cluster related types from arangojs/database module to new
    arangojs/clusters module

    The following types were moved: ClusterImbalanceInfo,
    ClusterRebalanceState, ClusterRebalanceOptions, ClusterRebalanceMove
    and ClusterRebalanceResult.

  • Moved hot backup related types from arangojs/database module to new
    arangojs/hot-backups module

    The following types were moved: HotBackupOptions, HotBackupResult and
    HotBackupList.

  • Moved query related types from arangojs/database module to new
    arangojs/queries module

    The following types were moved: QueryOptions, ExplainOptions,
    ExplainPlan, ExplainStats, SingleExplainResult, MultiExplainResult,
    AstNode, ParseResult, QueryCachePropertiesOptions, QueryCacheEntry,
    QueryCacheProperties, QueryOptimizerRule, QueryTracking,
    QueryTrackingOptions, QueryInfo and AqlUserFunction.

  • Moved service related types from arangojs/database module to new
    arangojs/services module

    The following types were moved: InstallServiceOptions,
    ReplaceServiceOptions, UpgradeServiceOptions, UninstallServiceOptions,
    ServiceSummary, ServiceInfo, ServiceConfiguration,
    SingleServiceDependency, MultiServiceDependency, ServiceTestStats,
    ServiceTestStreamTest, ServiceTestStreamReport, ServiceTestSuiteTest,
    ServiceTestSuite, ServiceTestSuiteReport, ServiceTestXunitTest,
    ServiceTestXunitReport, ServiceTestTapReport, ServiceTestDefaultTest,
    ServiceTestDefaultReport and SwaggerJson.

  • Moved user related types from arangojs/database module to new
    arangojs/users module

    The following types were moved: AccessLevel, ArangoUser, UserOptions,
    UserAccessLevelOptions and CreateDatabaseUser.

  • Moved server administration related types from arangojs/database module to
    new arangojs/administration module

    The following types were moved: CompactOptions, EngineInfo,
    EngineStatsInfo, LicenseInfo, QueueTimeMetrics, ServerAvailability,
    ServerStatusInformation, SingleServerSupportInfo, ClusterSupportInfo
    and VersionInfo.

  • Moved configuration related types to new arangojs/config module

    The following types were moved: Config, LoadBalancingStrategy,
    BasicAuthCredentials and BearerAuthCredentials.

  • Moved ArangoErrorResponse type to arangojs/connection module

    The type is now also no longer marked as internal.

  • Moved configuration related types to new arangojs/configuration module

    The following types were moved: ConfigOptions, LoadBalancingStrategy,
    BasicAuthCredentials and BearerAuthCredentials.

Renamed types

  • Renamed Index types to IndexDescription for consistency

    The specific index types were als...

Read more

v9.3.0

06 Jan 18:45
eeae04b

Choose a tag to compare

Added

  • Added db.compact method (DE-906)

  • Added db.engineStats method (DE-932)

  • Added db.getLicense and db.setLicense methods (DE-949)

  • Added db.listQueryCacheEntries method (DE-149)

  • Added db.clearQueryCache method (DE-148)

  • Added db.getQueryCacheProperties method (DE-150)

  • Added db.setQueryCacheProperties method (DE-151)

  • Added collection.shards method (DE-939)

  • Added support for mdi-prefixed indexes (DE-956)

  • Restored fulltext index type support (DE-957)

    The fulltext index type is still no longer supported for creating new
    indexes but can be used to cast existing indexes from Index.

  • Added support for edge indexes (DE-958)

    The Index type now can also be cast to the EdgeIndex type.

v10.0.0-rc.0

10 Dec 16:48
f558557

Choose a tag to compare

v10.0.0-rc.0 Pre-release
Pre-release

This is a preview release which is not intended for use in production and has been published under the npm next tag.

To install the latest preview release, run npm install arangojs@next.

See the migration guide for detailed instructions
for upgrading your code to arangojs v10.

Removed

  • Removed unused CreateUserOptions type

    The actual type used by the db.createUser method is still UserOptions.

  • Removed unused IndexDetails type

    This type was intended to be returned by collection.indexes when the
    withStats option is set to true but the figures property is already
    included in the current return type.

Changed

  • Closing a connection now closes all open requests

    Previously in certain situations only the most recent request would be
    closed per server. Note that this still merely aborts the requests but
    does not guarantee the underlying connections are closed as these are
    handled by Node.js or the browser natively. need to be installed
    otherwise.

  • Moved fetch-specific config options from into config.fetchOptions

    The following options were moved: credentials, headers and keepalive.

Error handling

  • Errors encountered before a request completes are now wrapped in a
    NetworkError or a subclass thereof

    This should help making it easier to diagnose network issues and distinguish
    the relevant error conditions.

    The originating error can still be accessed using the cause property of the
    NetworkError error.

  • HttpError now extends the NetworkError class

    This allows treating all non-ArangoError errors as one category of errors,
    even when there is no server response available.

  • db.waitForPropagation now throws a PropagationTimeoutError error when
    invoked with a timeout option and the timeout duration is exceeded

    The method would previously throw the most recent error encountered while
    waiting for replication. The originating error can still be accessed using
    the cause property of the PropagationTimeoutError error.

  • db.waitForPropagation now respects the timeout option more strictly

    Previously the method would only time out if the timeout duration was
    exceeded after the most recent request failed. Now the timeout is
    recalculated and passed on to each request, preventing it from exceeding
    the specified duration.

    If the propagation timed out due to an underlying request exceeding the
    timeout duration, the cause property of the PropagationTimeoutError
    error will be a ResponseTimeoutError error.

  • config.beforeRequest and config.afterResponse callbacks can now return
    promises

    If the callback returns a promise, it will be awaited before the request
    and response cycle proceeds. If either callback throws an error or returns
    a promise that is rejected, that error will be thrown instead.

  • config.afterResponse callback signature changed

    The callback signature previously used the internal ArangojsResponse type.
    The new signature uses the Response type of the Fetch API with an
    additional request property to more accurately represent the actual value
    it receives as the parsedBody property will never be present.

  • response property on ArangoError is now optional

    This property should always be present but this allows using the error in
    situations where a response might not be available.

General type changes

  • Changed GraphVertexCollection and GraphEdgeCollection generic types to
    take separate EntryResultType and EntryInputType type parameters

  • Changed db.collection, db.createCollection and db.createEdgeCollection
    methods to take separate EntryResultType and EntryInputType type
    parameters

    These type parameters are used to narrow the the returned collection type.

  • Changed db.removeUser method return type to Promise<void>

    The previous return type served no purpose.

  • Changed QueueTimeMetrics type to an interface

  • Changed CursorExtras and CursorStats interfaces to types

Low-level request/route changes

  • Renamed path option to pathname in RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Removed basePath option from RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Renamed route.path property to route.pathname

Renamed methods

  • Renamed various methods for consistency:

    Methods that return an array now follow the listNouns pattern, methods that
    return a "list of nouns" wrapped in an object have been renamed to follow the
    getNouns pattern to avoid confusion:

    • db.listServiceScripts -> db.getServiceScripts
    • db.listHotBackups -> db.getHotBackups
    • db.listFunctions -> db.listUserFunctions
    • db.getLogMessages -> db.listLogMessages
  • Renamed AQL user function management methods:

    • db.createFunction -> db.createUserFunction
    • db.dropFunction -> db.dropUserFunction

Module renaming

  • Renamed most modules to plural form for consistency

    The following modules were renamed:

    • arangojs/analyzer -> arangojs/analyzers
    • arangojs/collection -> arangojs/collections
    • arangojs/cursor -> arangojs/cursors
    • arangojs/database -> arangojs/databases
    • arangojs/error -> arangojs/errors
    • arangojs/graph -> arangojs/graphs
    • arangojs/job -> arangojs/jobs
    • arangojs/route -> arangojs/routes
    • arangojs/transaction -> arangojs/transactions
    • arangojs/view -> arangojs/views
  • Moved internal utility functions to new arangojs/lib/util module

    These methods are all still marked as internal and should not be used
    directly.

Moved types

  • Moved document related types from arangojs/collection module to
    arangojs/documents module

    The following types were moved: DocumentOperationFailure,
    DocumentOperationMetadata, DocumentExistsOptions,
    CollectionReadOptions, CollectionBatchReadOptions,
    CollectionInsertOptions, CollectionReplaceOptions,
    CollectionUpdateOptions, CollectionRemoveOptions,
    CollectionImportOptions, CollectionEdgesOptions,
    CollectionImportResult and CollectionEdgesResult

  • Moved index related types from arangojs/collection module to
    arangojs/indexes module

    The following types were moved: IndexListOptions.

  • Moved transaction related types from arangojs/database module to
    arangojs/transactions module

    The following types were moved: TransactionCollections,
    TransactionOptions and TransactionDetails.

  • Moved cluster related types from arangojs/database module to new
    arangojs/clusters module

    The following types were moved: ClusterImbalanceInfo,
    ClusterRebalanceState, ClusterRebalanceOptions, ClusterRebalanceMove
    and ClusterRebalanceResult.

  • Moved hot backup related types from arangojs/database module to new
    arangojs/hot-backups module

    The following types were moved: HotBackupOptions, HotBackupResult and
    HotBackupList.

  • Moved query related types from arangojs/database module to new
    arangojs/queries module

    The following types were moved: QueryOptions, ExplainOptions,
    ExplainPlan, ExplainStats, SingleExplainResult, MultiExplainResult,
    AstNode, ParseResult, QueryOptimizerRule, QueryTracking,
    QueryTrackingOptions, QueryInfo and AqlUserFunction.

  • Moved service related types from arangojs/database module to new
    arangojs/services module

    The following types were moved: InstallServiceOptions,
    ReplaceServiceOptions, UpgradeServiceOptions, UninstallServiceOptions,
    ServiceSummary, ServiceInfo, ServiceConfiguration,
    SingleServiceDependency, MultiServiceDependency, ServiceTestStats,
    ServiceTestStreamTest, ServiceTestStreamReport, ServiceTestSuiteTest,
    ServiceTestSuite, ServiceTestSuiteReport, ServiceTestXunitTest,
    ServiceTestXunitReport, ServiceTestTapReport, ServiceTestDefaultTest,
    ServiceTestDefaultReport and SwaggerJson.

  • Moved user related types from arangojs/database module to new
    arangojs/users module

    The following types were moved: AccessLevel, ArangoUser, UserOptions,
    UserAccessLevelOptions and CreateDatabaseUser.

  • Moved server administration related types from arangojs/database module to
    new arangojs/administration module

    The following types were moved: QueueTimeMetrics and VersionInfo.

  • Moved configuration related types to new arangojs/config module

    The following types were moved: Config, LoadBalancingStrategy,
    BasicAuthCredentials and BearerAuthCredentials.

  • Moved ArangoErrorResponse type to arangojs/connection module

    The type is now also no longer marked as internal.

  • Moved configuration related types to new arangojs/configuration module

    The following types were moved: ConfigOptions, LoadBalancingStrategy,
    BasicAuthCredentials and BearerAuthCredentials.

Renamed types

  • Renamed Index types to IndexDescription for consistency

    The specific index types were also renamed accordingly:

    • Index -> IndexDescription
    • GeoIndex -> GeoIndexDescription
    • PersistentIndex -> PersistentIndexDescription
    • PrimaryIndex -> PrimaryIndexDescription
    • TtlIndex -> TtlIndexDescription
    • MdiIndex -> MdiIndexDescription
    • InvertedIndex -> InvertedIndexDescription
    • InternalArangosearchIndex -> ArangosearchIndexDescription
    • InternalIndex -> InternalIndexDescription
    • HiddenIndex -> HiddenIndexDescription

    Note that the "Internal" prefix was drop...

Read more

v10.0.0-alpha.1

09 Dec 14:28
460cf2b

Choose a tag to compare

v10.0.0-alpha.1 Pre-release
Pre-release

This is a preview release which is not intended for use in production and has been published under the npm next tag.

To install the latest preview release, run npm install arangojs@next.

See the migration guide for detailed instructions
for upgrading your code to arangojs v10.

Changed

  • Renamed CollectionDropOptions type to DropCollectionOptions

  • Renamed CollectionTruncateOptions type to TruncateCollectionOptions

  • Renamed Config type to ConfigOptions

  • Renamed path option to pathname in RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Removed basePath option from RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Renamed route.path property to route.pathname

  • Changed error type constructor signatures

    The request property is now always positional and the options property
    is always optional.

  • Moved configuration related types to new config module

    The following types were moved: Config, LoadBalancingStrategy,
    BasicAuthCredentials and BearerAuthCredentials.

  • Moved ArangoErrorResponse type to connection module

    The type is now also no longer marked as internal.

  • Moved configuration related types to new configuration module

    The following types were moved: ConfigOptions, LoadBalancingStrategy,
    BasicAuthCredentials and BearerAuthCredentials.

  • Moved internal utility functions to new lib/util module

    These methods are all still marked as internal and should not be used
    directly.

  • Closing a connection now closes all open requests

    Previously in certain situations only the most recent request would be
    closed per server. Note that this still merely aborts the requests but
    does not guarantee the underlying connections are closed as these are
    handled by Node.js or the browser natively.

Added

  • Restored support for Unix domain sockets

    Using Unix domain sockets requires the undici library to be installed.

  • Restored support for config.agentOptions

    The config.agentOptions option can now be used to create a custom undici
    agent if the undici library is installed.