Releases: arangodb/arangojs
v10.2.2
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
Fixed
-
Fixed a JSON Parse error: Unexpected EOF occurring in the Bun runtime when using
documentExists,vertexExists, oredgeExists. 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
ECONNRESETerrors in NextJS 15 production builds when usingnext/cookies
by explicitly setting theContent-Lengthheader for all fixed-size request bodies.
The driver now calculates and setsContent-Lengthfor 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
Fixed
- Fixed
agentOptionsnot being passed tocreateHostfunction, preventing
configuration of undici agent for self-signed certificates and other TLS options.
TheagentOptionsparameter is now properly extracted from configuration and
passed to all host creation calls. (#824)
Added
-
Added
maxSkewThresholdandminDeletionRatiooptions toTierConsolidationPolicytype (DE-1094)These options are available from ArangoDB 3.12.7 onward and can be used for both arangosearch Views and inverted indexes.
-
Added
storedValuesoption 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
innerProductmetric support for vector indexesVector indexes now support the
innerProductmetric, 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, andAccessTokenListResponse
Access tokens can be used with:
- Basic Authentication:
db.useAccessToken(token)or
db.useBasicAuth("", token) - JWT exchange:
db.login("", token)ordb.login(username, token)
Note: The
valid_untiloption accepts only Unix timestamps (numbers in
seconds), not Date objects. Users must convert Date objects themselves:
Math.floor(date.getTime() / 1000). - Added
Deprecated
-
Deprecated consolidation policy options in
TierConsolidationPolicythat are ignored by ArangoDB 3.12.7+ (DE-1094)The following options are ignored by the server from v3.12.7 onwards:
segmentsMin,segmentsMax,segmentsBytesFloorandminScore. These fields remain in the type definition for backward compatibility but are marked as deprecated.
v10.1.2
What's Changed
- Update MIGRATING.md by @cmyk47 in #823
- Update code examples and a few test names due to renamed methods by @Simran-B in #826
- Vector Index Support by @apetenchea in #828
New Contributors
- @cmyk47 made their first contribution in #823
- @apetenchea made their first contribution in #828
Full Changelog: v10.1.1...v10.1.2
v10.1.1
v10.1.0
v10.0.0
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
CreateUserOptionstypeThe actual type used by the
db.createUsermethod is stillUserOptions. -
Removed unused
IndexDetailstypeThis type was intended to be returned by
collection.indexeswhen the
withStatsoption is set totruebut thefiguresproperty 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
configoptions from intoconfig.fetchOptionsThe following options were moved:
credentials,headersandkeepalive. -
db.setUserAccessLevelnow takesgrantas a separate parameterThe parameter was previously passed as an additional property in the
optionsparameter.
Error handling
-
Errors encountered before a request completes are now wrapped in a
NetworkErroror a subclass thereofThis should help making it easier to diagnose network issues and distinguish
the relevant error conditions.The originating error can still be accessed using the
causeproperty of the
NetworkErrorerror. -
HttpErrornow extends theNetworkErrorclassThis allows treating all non-
ArangoErrorerrors as one category of errors,
even when there is no server response available. -
db.waitForPropagationnow throws aPropagationTimeoutErrorerror when
invoked with atimeoutoption and the timeout duration is exceededThe method would previously throw the most recent error encountered while
waiting for replication. The originating error can still be accessed using
thecauseproperty of thePropagationTimeoutErrorerror. -
db.waitForPropagationnow respects thetimeoutoption more strictlyPreviously 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, thecauseproperty of thePropagationTimeoutError
error will be aResponseTimeoutErrorerror. -
config.beforeRequestandconfig.afterResponsecallbacks can now return
promisesIf 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.afterResponsecallback signature changedThe callback signature previously used the internal
ArangojsResponsetype.
The new signature uses theResponsetype of the Fetch API with an
additionalrequestproperty to more accurately represent the actual value
it receives as theparsedBodyproperty will never be present. -
responseproperty onArangoErroris now optionalThis property should always be present but this allows using the error in
situations where a response might not be available.
General type changes
-
Changed
GraphVertexCollectionandGraphEdgeCollectiongeneric types to
take separateEntryResultTypeandEntryInputTypetype parameters -
Changed
db.collection,db.createCollectionanddb.createEdgeCollection
methods to take separateEntryResultTypeandEntryInputTypetype
parametersThese type parameters are used to narrow the the returned collection type.
-
Changed
db.removeUsermethod return type toPromise<void>The previous return type served no purpose.
-
Changed
QueueTimeMetricstype to an interface -
Changed
CursorExtrasandCursorStatsinterfaces to types
Low-level request/route changes
-
Renamed
pathoption topathnameinRequestOptionstypeThis affects the
db.waitForPropagationandroute.requestmethods. -
Removed
basePathoption fromRequestOptionstypeThis affects the
db.waitForPropagationandroute.requestmethods. -
Renamed
route.pathproperty toroute.pathname
Renamed methods
-
Renamed various methods for consistency:
Methods that return an array now follow the
listNounspattern, methods that
return a "list of nouns" wrapped in an object have been renamed to follow the
getNounspattern to avoid confusion:db.listServiceScripts->db.getServiceScriptsdb.listHotBackups->db.getHotBackupsdb.listFunctions->db.listUserFunctionsdb.getLogMessages->db.listLogMessages
-
Renamed AQL user function management methods:
db.createFunction->db.createUserFunctiondb.dropFunction->db.dropUserFunction
Module renaming
-
Renamed most modules to plural form for consistency
The following modules were renamed:
arangojs/analyzer->arangojs/analyzersarangojs/collection->arangojs/collectionsarangojs/cursor->arangojs/cursorsarangojs/database->arangojs/databasesarangojs/error->arangojs/errorsarangojs/graph->arangojs/graphsarangojs/job->arangojs/jobsarangojs/route->arangojs/routesarangojs/transaction->arangojs/transactionsarangojs/view->arangojs/views
-
Moved internal utility functions to new
arangojs/lib/utilmoduleThese methods are all still marked as internal and should not be used
directly.
Moved types
-
Moved document related types from
arangojs/collectionmodule to
arangojs/documentsmoduleThe following types were moved:
DocumentOperationFailure,
DocumentOperationMetadata,DocumentExistsOptions,
CollectionReadOptions,CollectionBatchReadOptions,
CollectionInsertOptions,CollectionReplaceOptions,
CollectionUpdateOptions,CollectionRemoveOptions,
CollectionImportOptions,CollectionEdgesOptions,
CollectionImportResultandCollectionEdgesResult -
Moved index related types from
arangojs/collectionmodule to
arangojs/indexesmoduleThe following types were moved:
IndexListOptions. -
Moved transaction related types from
arangojs/databasemodule to
arangojs/transactionsmoduleThe following types were moved:
TransactionCollections,
TransactionOptionsandTransactionDetails. -
Moved cluster related types from
arangojs/databasemodule to new
arangojs/clustersmoduleThe following types were moved:
ClusterImbalanceInfo,
ClusterRebalanceState,ClusterRebalanceOptions,ClusterRebalanceMove
andClusterRebalanceResult. -
Moved hot backup related types from
arangojs/databasemodule to new
arangojs/hot-backupsmoduleThe following types were moved:
HotBackupOptions,HotBackupResultand
HotBackupList. -
Moved query related types from
arangojs/databasemodule to new
arangojs/queriesmoduleThe following types were moved:
QueryOptions,ExplainOptions,
ExplainPlan,ExplainStats,SingleExplainResult,MultiExplainResult,
AstNode,ParseResult,QueryCachePropertiesOptions,QueryCacheEntry,
QueryCacheProperties,QueryOptimizerRule,QueryTracking,
QueryTrackingOptions,QueryInfoandAqlUserFunction. -
Moved service related types from
arangojs/databasemodule to new
arangojs/servicesmoduleThe following types were moved:
InstallServiceOptions,
ReplaceServiceOptions,UpgradeServiceOptions,UninstallServiceOptions,
ServiceSummary,ServiceInfo,ServiceConfiguration,
SingleServiceDependency,MultiServiceDependency,ServiceTestStats,
ServiceTestStreamTest,ServiceTestStreamReport,ServiceTestSuiteTest,
ServiceTestSuite,ServiceTestSuiteReport,ServiceTestXunitTest,
ServiceTestXunitReport,ServiceTestTapReport,ServiceTestDefaultTest,
ServiceTestDefaultReportandSwaggerJson. -
Moved user related types from
arangojs/databasemodule to new
arangojs/usersmoduleThe following types were moved:
AccessLevel,ArangoUser,UserOptions,
UserAccessLevelOptionsandCreateDatabaseUser. -
Moved server administration related types from
arangojs/databasemodule to
newarangojs/administrationmoduleThe following types were moved:
CompactOptions,EngineInfo,
EngineStatsInfo,LicenseInfo,QueueTimeMetrics,ServerAvailability,
ServerStatusInformation,SingleServerSupportInfo,ClusterSupportInfo
andVersionInfo. -
Moved configuration related types to new
arangojs/configmoduleThe following types were moved:
Config,LoadBalancingStrategy,
BasicAuthCredentialsandBearerAuthCredentials. -
Moved
ArangoErrorResponsetype toarangojs/connectionmoduleThe type is now also no longer marked as internal.
-
Moved configuration related types to new
arangojs/configurationmoduleThe following types were moved:
ConfigOptions,LoadBalancingStrategy,
BasicAuthCredentialsandBearerAuthCredentials.
Renamed types
-
Renamed
Indextypes toIndexDescriptionfor consistencyThe specific index types were als...
v9.3.0
Added
-
Added
db.compactmethod (DE-906) -
Added
db.engineStatsmethod (DE-932) -
Added
db.getLicenseanddb.setLicensemethods (DE-949) -
Added
db.listQueryCacheEntriesmethod (DE-149) -
Added
db.clearQueryCachemethod (DE-148) -
Added
db.getQueryCachePropertiesmethod (DE-150) -
Added
db.setQueryCachePropertiesmethod (DE-151) -
Added
collection.shardsmethod (DE-939) -
Added support for
mdi-prefixedindexes (DE-956) -
Restored
fulltextindex type support (DE-957)The
fulltextindex type is still no longer supported for creating new
indexes but can be used to cast existing indexes fromIndex. -
Added support for
edgeindexes (DE-958)The
Indextype now can also be cast to theEdgeIndextype.
v10.0.0-rc.0
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
CreateUserOptionstypeThe actual type used by the
db.createUsermethod is stillUserOptions. -
Removed unused
IndexDetailstypeThis type was intended to be returned by
collection.indexeswhen the
withStatsoption is set totruebut thefiguresproperty 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
configoptions from intoconfig.fetchOptionsThe following options were moved:
credentials,headersandkeepalive.
Error handling
-
Errors encountered before a request completes are now wrapped in a
NetworkErroror a subclass thereofThis should help making it easier to diagnose network issues and distinguish
the relevant error conditions.The originating error can still be accessed using the
causeproperty of the
NetworkErrorerror. -
HttpErrornow extends theNetworkErrorclassThis allows treating all non-
ArangoErrorerrors as one category of errors,
even when there is no server response available. -
db.waitForPropagationnow throws aPropagationTimeoutErrorerror when
invoked with atimeoutoption and the timeout duration is exceededThe method would previously throw the most recent error encountered while
waiting for replication. The originating error can still be accessed using
thecauseproperty of thePropagationTimeoutErrorerror. -
db.waitForPropagationnow respects thetimeoutoption more strictlyPreviously 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, thecauseproperty of thePropagationTimeoutError
error will be aResponseTimeoutErrorerror. -
config.beforeRequestandconfig.afterResponsecallbacks can now return
promisesIf 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.afterResponsecallback signature changedThe callback signature previously used the internal
ArangojsResponsetype.
The new signature uses theResponsetype of the Fetch API with an
additionalrequestproperty to more accurately represent the actual value
it receives as theparsedBodyproperty will never be present. -
responseproperty onArangoErroris now optionalThis property should always be present but this allows using the error in
situations where a response might not be available.
General type changes
-
Changed
GraphVertexCollectionandGraphEdgeCollectiongeneric types to
take separateEntryResultTypeandEntryInputTypetype parameters -
Changed
db.collection,db.createCollectionanddb.createEdgeCollection
methods to take separateEntryResultTypeandEntryInputTypetype
parametersThese type parameters are used to narrow the the returned collection type.
-
Changed
db.removeUsermethod return type toPromise<void>The previous return type served no purpose.
-
Changed
QueueTimeMetricstype to an interface -
Changed
CursorExtrasandCursorStatsinterfaces to types
Low-level request/route changes
-
Renamed
pathoption topathnameinRequestOptionstypeThis affects the
db.waitForPropagationandroute.requestmethods. -
Removed
basePathoption fromRequestOptionstypeThis affects the
db.waitForPropagationandroute.requestmethods. -
Renamed
route.pathproperty toroute.pathname
Renamed methods
-
Renamed various methods for consistency:
Methods that return an array now follow the
listNounspattern, methods that
return a "list of nouns" wrapped in an object have been renamed to follow the
getNounspattern to avoid confusion:db.listServiceScripts->db.getServiceScriptsdb.listHotBackups->db.getHotBackupsdb.listFunctions->db.listUserFunctionsdb.getLogMessages->db.listLogMessages
-
Renamed AQL user function management methods:
db.createFunction->db.createUserFunctiondb.dropFunction->db.dropUserFunction
Module renaming
-
Renamed most modules to plural form for consistency
The following modules were renamed:
arangojs/analyzer->arangojs/analyzersarangojs/collection->arangojs/collectionsarangojs/cursor->arangojs/cursorsarangojs/database->arangojs/databasesarangojs/error->arangojs/errorsarangojs/graph->arangojs/graphsarangojs/job->arangojs/jobsarangojs/route->arangojs/routesarangojs/transaction->arangojs/transactionsarangojs/view->arangojs/views
-
Moved internal utility functions to new
arangojs/lib/utilmoduleThese methods are all still marked as internal and should not be used
directly.
Moved types
-
Moved document related types from
arangojs/collectionmodule to
arangojs/documentsmoduleThe following types were moved:
DocumentOperationFailure,
DocumentOperationMetadata,DocumentExistsOptions,
CollectionReadOptions,CollectionBatchReadOptions,
CollectionInsertOptions,CollectionReplaceOptions,
CollectionUpdateOptions,CollectionRemoveOptions,
CollectionImportOptions,CollectionEdgesOptions,
CollectionImportResultandCollectionEdgesResult -
Moved index related types from
arangojs/collectionmodule to
arangojs/indexesmoduleThe following types were moved:
IndexListOptions. -
Moved transaction related types from
arangojs/databasemodule to
arangojs/transactionsmoduleThe following types were moved:
TransactionCollections,
TransactionOptionsandTransactionDetails. -
Moved cluster related types from
arangojs/databasemodule to new
arangojs/clustersmoduleThe following types were moved:
ClusterImbalanceInfo,
ClusterRebalanceState,ClusterRebalanceOptions,ClusterRebalanceMove
andClusterRebalanceResult. -
Moved hot backup related types from
arangojs/databasemodule to new
arangojs/hot-backupsmoduleThe following types were moved:
HotBackupOptions,HotBackupResultand
HotBackupList. -
Moved query related types from
arangojs/databasemodule to new
arangojs/queriesmoduleThe following types were moved:
QueryOptions,ExplainOptions,
ExplainPlan,ExplainStats,SingleExplainResult,MultiExplainResult,
AstNode,ParseResult,QueryOptimizerRule,QueryTracking,
QueryTrackingOptions,QueryInfoandAqlUserFunction. -
Moved service related types from
arangojs/databasemodule to new
arangojs/servicesmoduleThe following types were moved:
InstallServiceOptions,
ReplaceServiceOptions,UpgradeServiceOptions,UninstallServiceOptions,
ServiceSummary,ServiceInfo,ServiceConfiguration,
SingleServiceDependency,MultiServiceDependency,ServiceTestStats,
ServiceTestStreamTest,ServiceTestStreamReport,ServiceTestSuiteTest,
ServiceTestSuite,ServiceTestSuiteReport,ServiceTestXunitTest,
ServiceTestXunitReport,ServiceTestTapReport,ServiceTestDefaultTest,
ServiceTestDefaultReportandSwaggerJson. -
Moved user related types from
arangojs/databasemodule to new
arangojs/usersmoduleThe following types were moved:
AccessLevel,ArangoUser,UserOptions,
UserAccessLevelOptionsandCreateDatabaseUser. -
Moved server administration related types from
arangojs/databasemodule to
newarangojs/administrationmoduleThe following types were moved:
QueueTimeMetricsandVersionInfo. -
Moved configuration related types to new
arangojs/configmoduleThe following types were moved:
Config,LoadBalancingStrategy,
BasicAuthCredentialsandBearerAuthCredentials. -
Moved
ArangoErrorResponsetype toarangojs/connectionmoduleThe type is now also no longer marked as internal.
-
Moved configuration related types to new
arangojs/configurationmoduleThe following types were moved:
ConfigOptions,LoadBalancingStrategy,
BasicAuthCredentialsandBearerAuthCredentials.
Renamed types
-
Renamed
Indextypes toIndexDescriptionfor consistencyThe specific index types were also renamed accordingly:
Index->IndexDescriptionGeoIndex->GeoIndexDescriptionPersistentIndex->PersistentIndexDescriptionPrimaryIndex->PrimaryIndexDescriptionTtlIndex->TtlIndexDescriptionMdiIndex->MdiIndexDescriptionInvertedIndex->InvertedIndexDescriptionInternalArangosearchIndex->ArangosearchIndexDescriptionInternalIndex->InternalIndexDescriptionHiddenIndex->HiddenIndexDescription
Note that the "Internal" prefix was drop...
v10.0.0-alpha.1
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
CollectionDropOptionstype toDropCollectionOptions -
Renamed
CollectionTruncateOptionstype toTruncateCollectionOptions -
Renamed
Configtype toConfigOptions -
Renamed
pathoption topathnameinRequestOptionstypeThis affects the
db.waitForPropagationandroute.requestmethods. -
Removed
basePathoption fromRequestOptionstypeThis affects the
db.waitForPropagationandroute.requestmethods. -
Renamed
route.pathproperty toroute.pathname -
Changed error type constructor signatures
The
requestproperty is now always positional and theoptionsproperty
is always optional. -
Moved configuration related types to new
configmoduleThe following types were moved:
Config,LoadBalancingStrategy,
BasicAuthCredentialsandBearerAuthCredentials. -
Moved
ArangoErrorResponsetype toconnectionmoduleThe type is now also no longer marked as internal.
-
Moved configuration related types to new
configurationmoduleThe following types were moved:
ConfigOptions,LoadBalancingStrategy,
BasicAuthCredentialsandBearerAuthCredentials. -
Moved internal utility functions to new
lib/utilmoduleThese 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
undicilibrary to be installed. -
Restored support for
config.agentOptionsThe
config.agentOptionsoption can now be used to create a customundici
agent if theundicilibrary is installed.