Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
This driver uses semantic versioning:
- A change in the bugfix version (e.g. X.Y.0 -> X.Y.1) indicates internal changes and should always be safe to upgrade.
- A change in the minor version (e.g. X.1.Z -> X.2.0) indicates additions and backwards-compatible changes that should not affect your code.
- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates breaking changes that require changes in your code to upgrade.
10.1.2 - 2025-06-30
Added
- Added vector index support
10.1.1 - 2025-01-13
Changed
-
Removed
Filefromsourceoption types in Foxx CRUD methods (#818)The
sourceoption type already includesBlob, whichFileextends.
10.1.0 - 2025-01-13
Added
-
Added
ignoreRevsoption toRemoveDocumentOptionstype (DE-947)This affects the
collection.removeandcollection.removeAllmethods.
10.0.0 - 2025-01-06
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 thewithStatsoption 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 theNetworkErrorerror. -
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 the
causeproperty 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, the
causeproperty of thePropagationTimeoutErrorerror 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.createEdgeCollectionmethods 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 thegetNounspattern 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 toarangojs/documentsmoduleThe following types were moved:
DocumentOperationFailure,DocumentOperationMetadata,DocumentExistsOptions,CollectionReadOptions,CollectionBatchReadOptions,CollectionInsertOptions,CollectionReplaceOptions,CollectionUpdateOptions,CollectionRemoveOptions,CollectionImportOptions,CollectionEdgesOptions,CollectionImportResultandCollectionEdgesResult -
Moved index related types from
arangojs/collectionmodule toarangojs/indexesmoduleThe following types were moved:
IndexListOptions. -
Moved transaction related types from
arangojs/databasemodule toarangojs/transactionsmoduleThe following types were moved:
TransactionCollections,TransactionOptionsandTransactionDetails. -
Moved cluster related types from
arangojs/databasemodule to newarangojs/clustersmoduleThe following types were moved:
ClusterImbalanceInfo,ClusterRebalanceState,ClusterRebalanceOptions,ClusterRebalanceMoveandClusterRebalanceResult. -
Moved hot backup related types from
arangojs/databasemodule to newarangojs/hot-backupsmoduleThe following types were moved:
HotBackupOptions,HotBackupResultandHotBackupList. -
Moved query related types from
arangojs/databasemodule to newarangojs/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 newarangojs/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 newarangojs/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,ClusterSupportInfoandVersionInfo. -
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->PrimaryIndexDescriptionEdgeIndex->EdgeIndexDescriptionTtlIndex->TtlIndexDescriptionFulltextIndex->FulltextIndexDescriptionMdiIndex->MdiIndexDescriptionMdiPrefixedIndex->MdiPrefixedIndexDescriptionInvertedIndex->InvertedIndexDescriptionInternalArangosearchIndex->ArangosearchIndexDescriptionInternalIndex->InternalIndexDescriptionHiddenIndex->HiddenIndexDescription
Note that the “Internal” prefix was dropped from
ArangosearchIndexDescriptionto more accurately reflect the index type name. The index type still refers to an internal index, however. -
Renamed various types for consistency:
Types representing an instance of a specific entity type in ArangoDB like a collection, graph or query now follow the
NounDescriptionnaming pattern:AqlUserFunction->UserFunctionDescriptionCollectionMetadata->CollectionDescriptionDatabaseInfo->DatabaseDescriptionGraphInfo->GraphDescriptionServiceInfo->ServiceDescriptionQueryInfo->QueryDescriptionTransactionDetails->TransactionDescription
Note that the
TransactionDescriptiontype used bydb.listTransactionsis slightly different from theTransactionInfotype used by methods ofTransactionobjects due to implementation details of ArangoDB.Types representing general information rather than an instance of something now generally follow the
NounInfonaming pattern, whereas types representing the result of an operation generally follow theNounResultorVerbNounResultnaming pattern:QueryTracking->QueryTrackingInfoServerStatusInformation->ServerStatusInfoCollectionImportResult->ImportDocumentsResultCollectionEdgesResult->DocumentEdgesResult
Types for options passed to methods now generally follow the
NounOptions,VerbNounOptionsorVerbNounAttributeOptionsnaming patterns:Config->ConfigOptionsTransactionCollections->TransactionCollectionOptionsCreateDatabaseUser->CreateDatabaseUserOptionsCollectionDropOptions->DropCollectionOptionsCollectionTruncateOptions->TruncateCollectionOptions-
IndexListOptions->ListIndexesOptions -
Collection document operations:
DocumentExistsOptions->DocumentExistsOptionsCollectionReadOptions->ReadDocumentOptionsCollectionBatchReadOptions->BulkReadDocumentsOptionsCollectionInsertOptions->InsertDocumentOptionsCollectionReplaceOptions->ReplaceDocumentOptionsCollectionUpdateOptions->UpdateDocumentOptionsCollectionRemoveOptions->RemoveDocumentOptionsCollectionImportOptions->ImportDocumentsOptionsCollectionEdgesOptions->DocumentEdgesOptions
-
Graph collection document operation:
GraphCollectionReadOptions->ReadGraphDocumentOptionsGraphCollectionInsertOptions->CreateGraphDocumentOptionsGraphCollectionReplaceOptions->ReplaceGraphDocumentOptionsGraphCollectionRemoveOptions->RemoveGraphDocumentOptionsViewPatchPropertiesOptions->UpdateViewPropertiesOptions
-
View operations:
ArangoSearchViewPatchPropertiesOptions->UpdateArangoSearchViewPropertiesOptionsSearchAliasViewPatchPropertiesOptions->UpdateSearchAliasViewPropertiesOptionsSearchAliasViewPatchIndexOptions->UpdateSearchAliasViewIndexOptionsArangoSearchViewStoredValueOptions->CreateArangoSearchViewStoredValueOptions
-
Renamed
ArrayCursorandBatchedArrayCursorclasses toCursorandBatchCursorrespectivelyThe previous name was misleading because it conflicted with how the ArangoDB distinguishes between array cursors and streaming cursors in the interactive shell. This distinction does not apply to the driver.
-
Renamed various types to reduce ambiguity:
ObjectWithId(inindexesmodule) ->ObjectWithIndexIdObjectWithId(indocumentsmodule) ->ObjectWithDocumentIdObjectWithKey(indocumentsmodule) ->ObjectWithDocumentKey
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 customundiciagent if theundicilibrary is installed. -
Added
config.fetchOptionsoptionThis option can now be used to specify default options for the
fetchfunction used by arangojs likeheaders,credentials,keepaliveandredirect. -
Added
BatchCursor#itemsViewproperty andBatchCursorItemsViewinterfaceThis property provides a low-level interface for consuming the items of the cursor and is used by the regular item-wise
Cursorclass internally. -
Added
SystemIndexDescriptiontypeThis type represents either of the system index types
primaryandedgeand can be used to cast indexes returned bycollection.indexes. -
Added
ProcessedResponsetypeThis type replaces the previously internal
ArangojsResponsetype and extends the nativeResponsetype with additional properties.
Error handling
-
Added
config.onErroroption (DE-955)This option can be used to specify a callback function that will be invoked whenever a request results in an error. Unlike
afterResponse, this callback will be invoked even if the request completed but returned an error status. In this case the error will be theHttpErrororArangoErrorrepresenting the error response.If the
onErrorcallback throws an error or returns a promise that is rejected, that error will be thrown instead. -
Added support for
config.fetchOptions.redirectoption (#613)This option can now be used to specify the redirect mode for requests.
When set to
"manual", arangojs will throw anHttpErrorwrapping the redirect response instead of automatically following redirects.Note that when set to
"error", the native fetch API will throw a non-specific error (usually aTypeError) that arangojs will wrap in aFetchFailedErrorinstead. -
Added optional
ArangoError#requestpropertyThis property is always present if the error has a
responseproperty. In normal use this should always be the case. -
Added
NetworkErrorclassThis is the common base class for all errors (including
HttpError) that occur while making a request. The originating error can be accessed using thecauseproperty. The request object can be accessed using therequestproperty.Note that
ArangoErrorand the newPropagationTimeoutErrorerror type do not extendNetworkErrorbut may wrap an underlying error, which can be accessed using thecauseproperty. -
Added
ResponseTimeoutErrorclassThis error extends
NetworkErrorand is thrown when a request deliberately times out using thetimeoutoption. -
Added
RequestAbortedErrorclassThis error extends
NetworkErrorand is thrown when a request is aborted by using thedb.closemethod. -
Added
FetchFailedErrorclassThis error extends
NetworkErrorand is thrown when a request fails because the underlyingfetchcall fails (usually with aTypeError).In Node.js the root cause of this error (e.g. a network failure) can often be found in the
causeproperty of the originating error, i.e. thecauseproperty of thecauseproperty of this error.In browsers the root cause is usually not exposed directly but can often be diagnosed by examining the developer console or network tab.
-
Added
PropagationTimeoutErrorclassThis error does not extend
NetworkErrorbut wraps the most recent error encountered while waiting for replication, which can be accessed using thecauseproperty. This error is only thrown whendb.waitForPropagationis invoked with atimeoutoption and the timeout duration is exceeded.
9.3.0 - 2025-01-06
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.
9.2.0 - 2024-11-27
Added
-
Added
db.availabilitymethod -
Added
db.enginemethod (DE-931) -
Added
db.statusmethod (#811) -
Added
db.supportInfomethod -
Added
keepNulloption toCollectionInsertOptionstype (DE-946)This option was previously missing from the type.
-
Added
allowDirtyReadoption toDocumentExistsOptionstype (DE-945)This option was previously missing from the type.
-
Added
ignoreRevsoption toCollectionBatchReadOptionstype (DE-947)This option was previously missing from the type.
-
Added
optionsargument toCollectionTruncateOptionstype (DE-940)There was previously no way to pass options to the
truncatemethod. -
Added
databaseproperty toAnalyzer,ArrayCursor,BatchedArrayCursor,Collection,Graph,Job,Route,TransactionandView(DE-935)This property can be used to access the database instance a given object belongs to.
-
Added
Route#headersandRoute#pathpropertiesThese properties can be used to access the headers and path used when creating the route.
-
Added
ArrayCursor#idandBatchedArrayCursor#idproperties (DE-936)This property can be used to access the ID of the cursor.
9.1.0 - 2024-09-25
Changed
-
Removed
progressproperty fromIndextypeThis property is only available when fetching indexes with the
withHiddenoption set totrue.
Added
-
Added
HiddenIndextype (DE-849)This type is used to represent an index returned by
collection.indexeswhen thewithHiddenoption is set totrueand includes theprogressproperty in addition to internal indexes.
9.0.0 - 2024-07-31
This is a major release and breaks backwards compatibility.
See the migration guide for detailed instructions for upgrading your code to arangojs v9.
Removed
-
Removed Node.js 14 and Node.js 16 support
With Node.js 14 and 16 having reached their end of life, arangojs will no longer support these versions of Node.js going forward.
For more information, see the Node.js release schedule.
-
Removed
ParamsandHeaderstypesThese can mostly be replaced with the native
URLSearchParamsandHeaderstypes but most public methods still accept the equivalentRecordtypes for convenience. -
Removed deprecated
FulltextIndexand related typesFulltext indexes have been deprecated in ArangoDB 3.10 and should be replaced with ArangoSearch.
-
Removed browser build
The browser build has been removed from the repository and will no longer be published to npm. The npm package can still be used in the browser by using common frontend tooling like webpack or rollup.
-
Removed
Collectionmethods for simple queries:list,all,any,byExample,firstExample,removeByExample,replaceByExample,updateByExample,lookupByKeys,removeByKeys,fulltextSimple queries were deprecated in ArangoDB 3.4 and can be replicated with AQL.
Changed
-
Replaced request logic with native
fetchAPI (#788, DE-578, DE-758)The node-specific request logic using the
httpandhttpsmodules has been replaced with all-new logic using the web standardfetchAPI, which should work in Node.js, browsers and other conformant environments. -
Unicode names are now no longer automatically NFC normalized (DE-65)
This change affects all database, collection, graph, view and analyzer names using unicode characters. Starting with arangojs v7.7.0 these names were automatically NFC normalized. This behavior has now been reverted to match the behavior of other ArangoDB drivers and help detect normalization issues in user code.
-
Changed return type of
aqland the AQLjoinhelper function toAqlQueryPreviously the internal
GeneratedAqlQuerytype was exposed as the return type of these functions, leading to complexity when handling generic type arguments. -
Removed dependency on Node
pathmodule or its browserify equivalentThis change should be backwards-compatible but may produce different results when using non-normalized paths and base-paths in custom
routes. This should help support more environments and reduce the size of the browser bundle. -
Inlined
x3-linkedlistdependencyInlining this dependency should help make arangojs more portable.
-
Split the Collection type parameter into result and input types (#807)
It is now possible to specify a separate type for the data passed when creating or modifying documents in addition to the type of the data returned when fetching documents. This allows excluding computed properties from the input type while still including them in the result type.
Added
-
Added ESM support (DE-236)
The driver now supports being imported as an ES module or CommonJS module and provides exports for both types of environments. This change should be backwards-compatible.
-
Added support for
withHiddenoption incollection.indexesThis option was introduced in ArangoDB 3.10.13 and 3.11.7 and allows fetching the progress information of indexes that are in the building phase.
-
Added support for
withStatsoption incollection.indexesThis method now takes an object with
withStatsandwithHiddenoptions instead of a boolean flag. -
Added readonly
Job#idpropertyThis property was not previously exposed.
-
Added
skipFastLockRoundoption for streaming transactionsThis option was introduced in 3.12.1 and allows skipping the fast lock round.
-
Added non-specific
EnsureIndexOptionstype andensureIndexmethod signature (#778)This allows creating indexes without narrowing the index type.
8.8.1 - 2024-03-20
Added
- Added the
versionAttributeoption to the document operation options types (DE-783)
8.8.0 - 2024-03-12
Changed
-
Renamed ZKD index type to MDI (DE-744)
The ZKD index type was previously marked as experimental and has now been finalized and renamed to MDI in ArangoDB 3.12.
-
Added
DocumentOperationMetadataandDocumentOperationFailuretypes (DE-693)The return types of document and edge operations on collections have been modified to correctly represent the return values of bulk operations and single document/edge operations using the
overwriteModeoption.
Deprecated
-
Deprecated active failover support (DE-746)
Active failover is no longer be supported in ArangoDB 3.12 and later. This functionality will be removed from the driver in a future release.
Added
-
Added support for
multi_delimiteranalyzer type (DE-753) -
Added support for
wildcardanalyzer type (DE-750)
8.7.0 - 2024-02-14
Changed
- Made
optionsargument incollection.edges,inEdgesandoutEdgesoptional (#802)
Deprecated
-
Deprecated
db.getLogMessagesThis API was deprecated in ArangoDB 3.8 and should no longer be used. Use
db.getLogEntriesinstead.
Fixed
- Fixed
db.getLogEntriesusing the wrong API endpoint
8.6.0 - 2023-10-24
Added
-
Added
db.createJobmethod to convert arbitrary requests into async jobs (DE-610)This method can be used to set the
x-arango-async: storeheader on any request, which will cause the server to store the request in an async job:const collectionsJob = await db.createJob(() => db.collections()); // once loaded, collectionsJob.result will be an array of Collection instances const numbersJob = await db.createJob(() => db.query(aql`FOR i IN 1..1000 RETURN i`) ); // once loaded, numbersJob.result will be an ArrayCursor of numbers
8.5.0 - 2023-10-09
Added
-
Implemented hot backup API (DE-576)
-
Implemented logging API (DE-144, DE-145, DE-146, DE-147)
-
Implemented async jobs management (DE-339)
-
Added
db.shutdownto initiate a clean shutdown of the server -
Added
db.timemethod to retrieve the server’s system time
8.4.1 - 2023-09-15
Fixed
- Fixed default return type of AQL queries being
undefinedinstead ofany(#797)
8.4.0 - 2023-07-10
Changed
-
Fetching additional cursor results now uses
POSTinstead ofPUT(DE-605)The
PUTroute was deprecated and thePOSTroute is supported in all actively maintained versions of ArangoDB. -
User management methods now use database-relative URLs (DE-606)
Previously these methods would make requests without a database prefix, implicitly using the
_systemdatabase. -
aqltemplate strings now take a generic type argumentThis allows explictly setting the item type of the
ArrayCursorreturned bydb.querywhen usingaqltemplate strings. Note that like when setting the type ondb.querydirectly, arangojs can make no guarantees that the type matches the actual data returned by the query.const numbers = await db.query(aql<{ index: number; squared: number }>` FOR i IN 1..1000 RETURN { index: i, squared: i * i } `); const first = await numbers.next(); // { index: number; squared: number; } console.log(first.index, first.squared); // 1 1
Fixed
-
Fixed
listUsersbehavior (#782) -
Fixed
graph.createnot correctly handlingisDisjointoption
Added
-
Added missing attributes to
QueryInfoandMultiExplainResult.statstypes (DE-607) -
Added cluster rebalancing methods to
Database(DE-583) -
Added
db.withTransactionhelper method for streaming transactions (#786)This method allows using streaming transactions without having to manually begin and commit or abort the transaction.
const vertices = db.collection("vertices"); const edges = db.collection("edges"); const info = await db.withTransaction([vertices, edges], async (step) => { const start = await step(() => vertices.document("a")); const end = await step(() => vertices.document("b")); return await step(() => edges.save({ _from: start._id, _to: end._id })); });
8.3.1 - 2023-06-05
Changed
- Added note that Simple Queries traversals are removed in ArangoDB 3.12.
8.3.0 - 2023-05-11
Fixed
- Fixed
updateUserandreplaceUserbehavior (#783)
Added
-
Added
renewAuthTokenmethod toDatabase(#784)This method allows refreshing the authentication token passed to the
useBearerAuthmethod or used by theloginmethod. Note that ArangoDB will currently only return a new token if the token is going to expire in the next 150 seconds. -
Added
returnOldandmergeObjectstoCollectionInsertOptionstypeThese options are only available when using
overwriteMode. -
Added caching options to
InvertedIndexandArangoSearchViewtypesThese options were added in ArangoDB 3.10.2.
-
Added support for
ArangoSearchViewtypestoredValuesshorthand notationInstead of using an object, attributes can also be defined as arrays of strings and arrays of arrays of strings. This was added in ArangoDB 3.10.3.
-
Added
peakMemoryUsageandexecutionTimetoSingleExplainResult.statstypeThese attributes were added in ArangoDB 3.10.4.
-
Added
geo_s2Analyzer typesThis Analyzer was added in ArangoDB 3.10.5.
-
Added
refillIndexCachesoption to document operation options typesThis option was added in ArangoDB 3.11.
-
Added
optimizeTopKtoArangoSearchViewandInvertedIndextypesThis option was added in ArangoDB 3.11.
-
Added support for
allowRetryoption indb.queryThis feature was added in ArangoDB 3.11.
-
Added
x-arango-driverheaderThe arangojs driver now correctly identifies itself to ArangoDB, allowing the ArangoGraph Insights Platform to take advantage of the driver’s support for cloud-optimized behaviors.
8.2.1 - 2023-04-05
Fixed
-
Fixed a bug in search parameter handling in the browser version
Previously the browser version would incorrectly handle search parameters, which could result in invalid request URLs in many cases.
8.2.0 - 2023-03-29
Changed
-
Index names are now automatically NFC-normalized (DE-506)
This change affects all index names using unicode characters. The change has no effect when using non-unicode (ASCII) names.
Any names used when creating/ensuring indexes or passed to any methods that expect an
IndexSelectorwill automatically be NFC normalized. -
Internal querystring handling logic now uses
URLSearchParamsinstead of nodequerystringmoduleThis change should be backwards compatible but may produce different results when relying on undefined behavior in custom (e.g. Foxx) routes.
8.1.0 - 2022-12-19
Added
- Added support for new ArangoDB 3.9.5
cachefield in ArangoSearch types
8.0.0 - 2022-10-25
This is a major release and breaks backwards compatibility.
See the migration guide for detailed instructions for upgrading your code to arangojs v8.
Removed
-
Removed Node.js 10 and Node.js 12 support
With Node.js 10 and 12 having reached their end of life, arangojs will no longer support these versions of Node.js going forward.
-
Removed Internet Explorer and older browser support
As of version 8 arangojs uses the Browserlist
defaultslist to generate the pre-built browser bundle, which excludes older browsers and specifically all versions of Internet Explorer.You may still be able to use arangojs in some of the excluded browsers when bundling arangojs yourself but this may require polyfills and additional transformations.
-
Removed
Dicttype fromconnectionmoduleThe
Dict<T>type was identical toRecord<string, T>and has been replaced with this built-in type across arangojs. -
Removed workaround for ArangoDB pre-3.2.8 Foxx HTTP API responses
When fetching or modifying the configuration or dependencies of a Foxx service using ArangoDB 3.2.7 and earlier, arangojs would perform additional operations to convert the server response to a compatible format. All affected versions of ArangoDB have reached End of Life since December 2018.
-
Removed deprecated
db.useDatabasemethodThe method was previously deprecated and can be replaced with
db.database, which returns a newDatabaseobject instead of modifying the existing one. -
Removed deprecated MMFiles methods and types
The MMFiles storage engine was removed in ArangoDB 3.7.
-
Removed deprecated
minReplicationFactoroption from collection and database related typesThis option was renamed to
writeConcernin ArangoDB 3.6. -
Removed deprecated
overwriteoption fromCollectionInsertOptionstypeThis option was deprecated in ArangoDB 3.7 and should be replaced with the
overwriteModeoption. -
Removed internal
request.hostattributeThis attribute has been replaced with
request.hostUrl. -
Removed internal
response.arangojsHostIdattributeThis attribute has been replaced with
response.arangojsHostUrl. -
Removed
CollectionStatusandCollectionTypeenum re-exportsPreviously these would be re-exported by the arangojs module for backwards compatibility. If you still need to access these enums, you can import them from the
collectionsub-module instead. Note that theViewTypeenum has been removed completely.
Changed
-
Changed default URL to
http://127.0.0.1:8529to match ArangoDB defaultPreviously arangojs would use
localhostwhich on some systems resolves to the IPv6 address::1instead, resulting in confusing connection errors. -
Changed TypeScript compilation target to ES2020
Since all evergreen browsers including Firefox ESR and all active Node.js LTS releases fully support ES2020, the compilation target for the browser bundle and Node.js has been moved from ES2016 and ES2018 respectively to ES2020.
-
Updated TypeScript to version 4.8
This may result in type signatures that are incompatible with TypeScript 3 being added in future releases (including patch releases).
-
Changed default behavior of internal
db.requestmethodPreviously this method would always return the full response object if no
transformcallback was provided. The method now defaults to atransformcallback that extracts the response body instead. The previous behavior can still be forced by passingfalseinstead of a callback function.This change has no effect on other methods like
route.request. -
Replaced node core module polyfills with native APIs in browser build
As part of upgrading to webpack 5, arangojs now no longer requires node core modules to be polyfilled to work in the browser. This also drastically reduces the file size of the pre-built browser bundle
arangojs/web. -
db.querynow supports a generic return type (#764)This allows explictly setting the item type of the
ArrayCursorreturned by the query without using a type assertion on the promise result. Note that arangojs can make no guarantees that the type matches the actual data returned by the query.const numbers = await db.query<{ index: number; squared: number }>(aql` FOR i IN 1..1000 RETURN { index: i, squared: i * i } `); const first = await numbers.next(); // { index: number; squared: number; } console.log(first.index, first.squared); // 1 1 -
Moved
aql.literalandaql.joinintoaqlmodulePreviously these were available as methods on the
aqlfunction. Now they need to be imported from theaqlmodule. -
Changed return values of
db.getUserAccessLevelanddb.getUserDatabasesto match documented return types -
Retry requests resulting in status 503
ArangoError(#710)Unless retries are explicitly disabled by setting
config.maxRetriestofalse, requests will now also be retried if the server responded with a 503ArangoError, which ArangoDB uses to indicate the server is running in maintenance mode. Previously this would always result in an error. -
Extended
CursorExtrastype in TypeScriptThe types of the attributes
plan,profile, andstatsare now defined more explicitly. -
Changed behavior of
collection.removeAllfor non-string arraysPreviously
collection.removeAllwould always convert its argument into an array of document IDs and fail with an error if passed any documents had an ID not matching the collection name. Now the selector argument is passed as-is, bypassing this validation but allowingignoreRevsto be respected by the server. -
Extracted type
ArangoSearchViewLinkOptionsfromArangoSearchViewLinkNote that
ArangoSearchViewLinknow represents the type of the value returned by the server, marking several properties as required. -
Extracted type
CreateArangoSearchViewfromArangoSearchViewPropertiesOptionsNote that
ArangoSearchViewPropertiesOptionsnow includes only those options that can be updated/replaced whereasCreateArangoSearchViewalso includes options that can only be set during creation of a view. -
Renamed type
GraphCreateOptionstoCreateGraphOptions -
Renamed type
PrimarySortCompressiontoCompression -
Replaced type
AnalyzerInfoand all its constituent typesPreviously each type of Analyzer was represented by an
AnalyzerInfotype and (where relevant) anAnalyzerPropertiestype, which were used for both creating and fetching Analyzers. The new types more closely follow the pattern already used for index types, providing pairs ofCreateAnalyzerOptionsandAnalyzerDescriptiontypes. -
Removed enum
ViewType, typeArangoSearchViewand changedViewclass to be non-genericThe
Viewclass now behaves analogous to theAnalyzerclass. The various types related to different view types have been restructured to more closely follow the pattern used for indexes and analyzers.
Deprecated
-
Deprecated
EnsureFulltextIndexOptionsandFulltextIndextypesFulltext indexes have been deprecated in ArangoDB 3.10 and should be replaced with ArangoSearch.
-
Deprecated
BytesAccumConsolidationPolicytypeThe
bytes_accumconsolidation policy for views was deprecated in ArangoDB 3.7 and should be replaced with thetierconsolidation policy. The type is also no longer supported inArangoSearchViewPropertiesOptions.
Added
-
Added
toJSONmethod to system errorsArangoJS already adds the
requestobject to system errors encountered while attempting to make network requests. This change makes it easier to serialize these error objects to JSON the same wayArangoErrorandHttpErrorobjects can already be serialized. -
Added
allowDirtyReadoption todb.beginTransaction,trx.commit,trx.abort,collection.edges,collection.inEdges,collection.outEdgesThe option is only respected by read-only requests.
-
Added support for
ifMatchandifNoneMatchoptions (#707) -
Added
overwriteoption todb.acquireHostList(#711)Setting this option to
truewill replace the current host list, removing any hosts no longer present in the cluster. -
Added new ArangoDB 3.10
legacyPolygonsoption toEnsureGeoIndexOptionsandGeoIndextypesGeo indexes created in ArangoDB pre-3.10 will implicitly default this option to
true. ArangoDB 3.10 and later will default tofalseand use the new parsing rules for geo indexes. -
Added support for new ArangoDB 3.10
cacheEnabledandstoredValuesoptions in persistent indexes -
Added support for new ArangoDB 3.10 computed values in collections
-
Added support for new ArangoDB 3.10
InvertedIndextype -
Added support for new ArangoDB 3.10
offsetAnalyzer feature -
Added support for new ArangoDB 3.10
minhash,classificationandnearest_neighborsAnalyzer types -
Added missing
replicationFactorandwriteConcernoptions toCollectionPropertiesOptionstype -
Added missing
commitIntervalMsecoption toArangoSearchViewPropertiestype -
Added missing
deduplicateoption toEnsurePersistentIndexOptionstype (#771) -
Added missing
uniqueoption toEnsureZkdIndexOptionstype -
Added missing
deduplicateandestimatesfields toPersistentIndextype -
Added new ArangoDB 3.10
db.queryRulesmethod -
Added support for
AnalyzerinaqltemplatesAnalyzerobjects can now be passed intoaqltemplates likeViewandArangoCollectionobjects. -
Added
retryOnConflictoption toConfigIf set to any number, this value will be used as the default value for all requests unless explicitly overridden when using
db.queryorroute.request.
7.8.0 - 2022-05-19
Added
-
Added
retryOnConflictoption todb.queryandroute.requestThis option allows specifying the number of times the request will be retried if it results in a write-write conflict.
7.7.0 - 2022-01-26
Changed
-
Unicode names are now automatically NFC normalized
This change affects all database, collection, graph, view and analyzer names using unicode characters. The change has no effect when using non-unicode (ASCII) names. At this time, ArangoDB does not support unicode characters in any of these names but experimental support for unicode database names is available in ArangoDB 3.9 using the
--database.extended-names-databasesstartup option.Any names used to create
Database,Collection, etc instances or passed to methods will automatically be NFC normalized. Additionally the collection name part of any value passed as aDocumentSelectorand the collection name part of values returned bycollection.documentIdwill automatically be NFC normalized.
Deprecated
-
Deprecated
EnsureHashIndexOptionsandEnsureSkiplistIndexOptionstypesThe hash and skiplist index types have been deprecated in ArangoDB 3.9 and should be replaced with persistent indexes which behave identically.
-
Deprecated all MMFiles related options and methods
The MMFiles storage engine was removed in ArangoDB 3.7.
Added
-
Added support for new ArangoDB 3.9
CollationAnalyzerandSegmentationAnalyzertypes -
Added support for new ArangoDB 3.9 (multi-dimensional)
ZkdIndextype -
Added support for new ArangoDB 3.9 Hybrid SmartGraphs graph options
-
Added support for new ArangoDB 3.9 response queue time reporting
This adds the
db.queueTimeproperty, which provides methods for accessing queue time metrics reported by the most recently received server responses if the server supports this feature. -
Added
ArangoSearchViewLink#inBackground(#759) -
Added
collection.compact(#630)
7.6.1 - 2021-10-26
Fixed
-
Changed all uses of
Record<string, unknown>toRecord<string, any>(#750)This should allow using more specific types without having to implement index signatures.
7.6.0 - 2021-10-20
Added
-
Added
collection.documentsfor fetching multiple documents -
Added support for
fillBlockCachequery option -
Added support for passing
Graphobjects in AQL queries (#740)This also adds the
isArangoGraphhelper function for type checking. -
Added User Management API (#664)
This implements the endpoints of the HTTP Interface for User Management
Fixed
-
Added missing
hexoption toStopwordsAnalyzertype (#732) -
Added missing
detailsoption tocollection.figures(#728) -
Added missing
inBackgroundoption to index options (#734)
7.5.0 - 2021-04-22
Added
-
Added support for new ArangoDB 3.8 Analyzer types
This adds the
PipelineAnalyzer,AqlAnalyzer,GeoJsonAnalyzer,GeoPointAnalyzerandStopwordsAnalyzertypes in TypeScript, as well as the Analyzer-specific properties types. -
Added support for new ArangoDB 3.8
estimatesoption for indexesThis affects the
PersistentIndex,HashIndexandSkiplistIndextypes in TypeScript.
7.4.0 - 2021-04-09
Added
-
Implemented
toJSONmethods forArangoErrorandHttpError(#632)This prevents an error where
JSON.stringifywould reliably throw if passed an instance of either of these error types generated by arangojs. Note that you may still want to implement your own JSON representation logic as system errors (e.g.ECONNREFUSED) are not wrapped by arangojs and thrown as-is.
Fixed
-
Stack traces are now improved for most errors when using
precaptureStackTraces(#722)Previously this option would only affect network errors, making it far less useful than intended. Now parsing errors,
ArangoErrorinstances and HTTP errors also receive improved error stack traces when this option is enabled. -
Improved performance for
precaptureStackTraceswhen no errors occurThe generated stack is now only accessed on demand, allowing the runtime to delay generation of the stack trace string. Previously the stack would always be accessed prior to the request being sent, causing a noticeable delay even when no error occurs.
-
Fixed document selector validation in
collection.edgesand its variants (#704)These methods previously only permitted start vertices that are documents within the edge collection itself. This behavior has now been corrected to permit start vertices outside the collection, as expected.
7.3.0 - 2021-03-08
Changed
-
Changed the default for
agentOptions.schedulingto"lifo"This is already the default in Node v15.6 but can reduce latency caused by sockets expiring, especially with larger connection pools and infrequent requests.
-
Removed
keepAlive-specific throughput optimizationPreviously arangojs would allow
agentOptions.maxSockets * 2concurrent requests, to optimize socket reuse by avoiding idle time. This behavior could trigger deadlocks when attempting to perform multiple transactions in parallel and only marginally improved throughput in some high-load scenarios. The connection pool size now always reflects the value set inagentOptions.maxSocketsregardless of whetherkeepAliveis enabled. -
Changed
agentOptions.maxSocketsdefault value when usingROUND_ROBINAs the connection pool is shared across all server connections when using
ROUND_ROBINload balancing, the default value of3is too limiting for most scenarios involving multiple coordinators. When passing multiple URLs via theurloption and specifyingROUND_ROBINload balancing, arangojs will now default this value tourl.length * 3instead.
7.2.0 - 2020-12-02
Added
-
Added
db.waitForPropagationmethodThis method helps with setting up databases in a cluster scenario by waiting for a request to succeed on every known coordinator.
7.1.1 - 2020-11-30
This is a maintenance release and contains no bugfixes or features.
7.1.0 - 2020-10-16
Changed
- Killing a cursor now also drains it locally
Fixed
- Fixed a potential memory leak in cursor batch handling
7.0.2 - 2020-09-25
Fixed
-
Fixed incorrect HTTP method call in
patchmethod (#687) -
Fixed empty query results containing
[undefined](#683) -
Fixed
updateByExampleandreplaceByExamplenew value parameter nameNote that these methods are still deprecated. Previously the
newValueparameter was incorrectly callednewData, which prevented the methods from working at all.
7.0.1 - 2020-08-21
This is a maintenance release because the initial v7 release did not include a README file.
7.0.0 - 2020-08-21
This is a major release and breaks backwards compatibility.
See the migration guide for detailed instructions for upgrading your code to arangojs v7.
For a detailed list of changes between pre-release versions of v7 see the Changelog of the final v7 release candidate.
Removed
General
-
Removed ArangoDB 2.8 support
ArangoDB 2.8 has reached End of Life since mid 2018. Version 7 and above of arangojs will no longer support ArangoDB 2.8 and earlier.
-
Removed Node.js 6/8 support
As of version 7 arangojs now requires language support for async/await. This means arangojs requires Node.js 10 (LTS) or newer to function correctly.
-
Removed support for absolute endpoint URLs
This removes the
isAbsoluteoption from the arangojs configuration. -
Removed
ArangoErrorre-exportThe type can still be imported directly from the
errormodule. -
Removed
statusCodeproperties ofArangoErrorandHttpErrorBoth of these error types still expose the HTTP status code as the
codeproperty. ForArangoErrorthe true HTTP status code may be different and can still be accessed using theresponse.statusCodeproperty.
Database API
-
Removed
db.edgeCollectionmethodAs arangojs 7 uses the same implementation for document and edge collections, this method is no longer necessary. Generic collection objects can still be cast to
DocumentCollectionorEdgeCollectiontypes in TypeScript. -
Removed
db.truncateconvenience methodThis was a wrapper around
db.listCollectionsandcollection.truncate. The behavior ofdb.truncatecan still be emulated by calling these methods directly.
Collection API
-
Removed collection
createCapConstraint,createHashIndex,createSkipList,createPersistentIndex,createGeoIndexandcreateFulltextIndexmethodsThese methods are no longer part of the official ArangoDB API and can be replaced by using the
collection.ensureIndexmethod. -
Removed
save(fromId, toId, edgeData)method variantsMethods for creating edges now require the
_toand_fromattributes to be specified in the edge (document) data and no longer accept these values as positional arguments. -
Removed
collection.bulkUpdatemethodThe new method
collection.updateAllnow provides this functionality. -
Removed
collection.edgemethodThis method was previously an alias for
collection.document.The method
graphEdgeCollection.edgeis unaffected by this change. -
Removed
graphNameoption foredgeCollection.traversalGraph traversals can still be performed via
graph.traversal.
Graph API
-
Removed generic collection methods from
GraphVertexCollectionAll methods that are not part of the graph API have been removed. The underlying collection can still be accessed from the
collectionproperty. -
Removed generic collection methods from
GraphEdgeCollectionAll methods that are not part of the graph API have been removed. The underlying collection can still be accessed from the
collectionproperty.
Cursor API
-
Removed
cursor.someandcursor.everymethodsThese methods encouraged overfetching and should be replaced with more efficient AQL queries.
The behavior can still be implemented by using the
nextmethod directly or iterating over the cursor using theforEachmethod or thefor awaitsyntax.
View API
-
Removed
ViewResponsetypeThe type
ViewDescriptionrepresents the same structure. -
Removed
ArangoSearchViewPropertiesResponsetypeThe type
ArangoSearchViewProperties & ViewDescriptioncan be used to represent the same structure.
Deprecated
Database API
-
Deprecated
db.useDatabasemethodUsing this method will affect
Collection,Graphand other objects already created for the given database and change which database these refer to, which may cause unexpected behavior.As of arangojs 7 the
db.databasemethod can be used instead to create a new, separateDatabaseobject using the same connection pool.
Collection API
-
Deprecated
Collectionmethods for simple queries:list,all,any,byExample,firstExample,removeByExample,replaceByExample,updateByExample,lookupByKeys,removeByKeys,fulltextThese methods were deprecated in ArangoDB 3.4 and should no longer be used. They will still behave correctly with versions of ArangoDB supporting these methods but may be removed in a future ArangoDB release.
Their behavior can be emulated using AQL queries.
Graph API
-
Deprecated
graph.traversalandcollection.traversalThese methods were deprecated in ArangoDB 3.4 and should no longer be used. They will still behave correctly with versions of ArangoDB supporting these methods but may be removed in a future ArangoDB release.
Their behavior can be emulated using AQL graph traversal.
Changed
General
-
Multiple
Databaseobjects can now share a singleConnectionAll arangojs objects now reference a
Databaseobject rather than accessing the underlyingConnectiondirectly. This allows multipleDatabaseobjects to be created by using thedb.databasemethod while still allowing the creation of separate database objects with separate connection pools if desired. -
Memoized
Database,Collection,Graph,ViewandAnalyzerDatabase objects are now memoized per-connection and the other object types are memoized per-database. Using
useDatabasede-memoizes the database object to prevent unexpected behavior. -
Added support for
Viewinaqltemplates (#667)View(orArangoSearchView) objects can now be passed intoaqltemplates likeArangoCollectionobjects. -
Moved
collectionToStringhelper intocollectionmodule -
Moved
Dicttype intoconnectionmodule -
Moved
Patchtype intodocumentsmodule -
Removed
Errbacktype from public API -
Renamed
util/foxx-manifestmodule tofoxx-manifest
Database API
-
Renamed method
db.arangoSearchViewtodb.view -
Renamed method
db.createArangoSearchViewtodb.createView -
Replaced methods
db.enableServiceDevelopmentModeanddb.disableServiceDevelopmentModewithdb.setServiceDevelopmentMode -
Flattened database
querymethodoptionsargumentThe optional
optionsargument previously contained an additionaloptionsobject with additional query options. These options are now specified on theoptionsargument itself directly.Before:
db.query(aql`FOR doc IN ${collection} RETURN doc`, { cache: false, options: { fullCount: true }, });After:
db.query(aql`FOR doc IN ${collection} RETURN doc`, { cache: false, fullCount: true, }); -
Changed
db.listServicesoptionexcludeSystemdefault totrueTo be more consistent with the equivalent options in other methods, the default value has been changed from
falsetotrue. -
Changed
db.createDatabasereturn type toDatabase -
Renamed
db.setQueryTrackingtodb.queryTrackingThe method will now return the existing query tracking properties or set the new query tracking properties depending on whether an argument is provided.
-
Method
db.transactionno longer acts as an alias forexecuteTransactionThe method now only allows looking up transactions by ID. Previously it would wrap
executeTransactionif passed the arguments expected by that method.
Collection API
-
Merged
DocumentCollectionandEdgeCollectionAPIsAll collections are now implemented as generic
Collectionobjects. In TypeScript the generic collection object can still be explicitly cast toDocumentCollectionorEdgeCollectionfor stricter type safety. -
Renamed
collection.setPropertiestocollection.propertiesThe method will now return the existing properties or set the properties depending on whether an argument is provided.
-
Removed
CollectionMetadatafields fromCollectionPropertiestypeMethods that previously returned
CollectionPropertiesnow returnCollectionMetadata & CollectionProperties. -
Collection methods
save,update,replaceandremoveno longer take arrays as inputThe array versions have been renamed to
saveAll,updateAll,replaceAllandremoveAllto reduce the likelihood of mistakes and provide more helpful type signatures. -
Collection methods will now throw errors when passed documents or document IDs from different collections where a document key or ID for a document in the same collection is expected
For example the following code will now result in an error rather than the document from a different collection being returned:
const aliceId = "alice/123"; // Document from collection "alice" const bobCol = db.collection("bob"); // Collection "bob" const doc = await bobCol.document(aliceId); // THROWS -
Changed
collection.importoptiontypebehaviorPreviously this option would always default to
"auto".When passing a
string,BufferorBlobas data, the option now defaults toundefined. This matches the behavior in previous versions of setting the option explicitly tonull.Additionally, the value
"array"has been replaced with"list".When passing an array as data, the option is now no longer supported as the corresponding value will be inferred from the array’s contents:
If the array’s first item is also an array, it will match the behavior in previous versions of setting the option explicitly to
null.Otherwise it will match the behavior in previous versions of setting the option explicitly to
"documents"or"auto", or omitting it entirely. -
Changed
collection.listreturn type toArrayCursor
Graph API
-
Graph methods now also accept
ArangoCollectioninstances instead of namesThis brings these methods behavior in line with that of the
beginTransactionandexecuteTransactionmethods ofDatabaseobjects. -
Graph
createmethod (anddb.createGraph) signature changedThe
graph.createmethod now takes an array of edge definitions as the first argument and any additional options (not just thewaitForSyncoption) as the second argument.Before:
await graph.create( { edgeDefinitions: [{ collection: "edges", from: ["a"], to: ["b"] }], isSmart: true, }, { waitForSync: true } );After:
await graph.create([{ collection: "edges", from: ["a"], to: ["b"] }], { isSmart: true, waitForSync: true, }); -
First argument to
graph.replaceEdgeDefinitionis now optionalSince the new edge definition already includes the edge collection name that identifies the edge definition, it is now possible to specify only the new edge definition object without additionally specifying the collection name as the first argument.
Before:
await graph.replaceEdgeDefinition("edges", { collection: "edges", // This is a bit redundant from: ["a"], to: ["b"], });After:
await graph.replaceEdgeDefinition({ collection: "edges", from: ["a"], to: ["b"], }); -
Graph collection return values now contain
oldandnewproperties whenreturnOldorreturnNewoptions are usedThis behavior represents a compromise between remaining consistent with the behavior of the regular collection method equivalents and remaining compatible with the ArangoDB HTTP API response object quirks.
Cursor API
-
Replaced
ArrayCursormethodshasNextandhasMorewith getters -
Renamed
ArrayCursormethodeachtoforEach -
Renamed
cursor.nextBatchtocursor.batches.next -
Renamed
cursor.hasMoretocursor.batches.hasMore -
In TypeScript
ArrayCursoris now a generic typeTypeScript users can now cast cursor instances to use a specific type for its values rather than
anyto aid type safety.
View API
-
Renamed
view.setPropertiestoview.updateProperties -
Renamed type
ArangoViewtoView
Analyzer API
- Renamed type
ArangoAnalyzertoAnalyzer
Transaction API
-
Renamed type
ArangoTransactiontoTransaction -
Renamed
transaction.runtotransaction.stepThis should hopefully make it more obvious that sequential calls to arangojs methods should be split into separate calls of this method.
Added
General
-
Added
databaseNameconfiguration optionSetting this option to a database name will result in the initial
Databaseobject using this database instead of the default_systemdatabase. -
Added
authconfiguration optionIt is now possible to pass authentication credentials using the
authoption in addition to callingdb.useBasicAuthordb.useBearerAuth. -
Added
precaptureStackTracesconfiguration option (#599)This option can be used to get more useful stack traces but results in a performance hit on every request.
-
Added
beforeandafterto theagentOptionsconfiguration option (#585)These methods can be used to track performance metrics for outgoing requests.
-
Improved type signatures for TypeScript and inline documentation
Most methods should now provide full type signatures for options and response objects and provide inline documentation in IDEs and editors that support this feature in TypeScript and JavaScript.
Database API
-
Added
db.databasemethodThis method replaces the use case for the deprecated
db.useDatabasemethod. -
Added support for extended options in
db.createDatabaseThis method now supports passing an extended options object instead of passing the users array directly.
-
Added
db.createCollectionanddb.createEdgeCollectionmethodsThese are convenience methods wrapping
collection.create. In TypeScriptcreateEdgeCollectionwill return a collection cast to theEdgeCollectiontype. -
Added
db.createGraphmethodThis is a convenience method wrapping
graph.create. -
Added
db.createArangoSearchViewmethodThis is a convenience method wrapping
view.create. -
Added
db.createAnalyzermethodThis is a convenience method wrapping
analyzer.create. -
Added support for
db.createFunctionoptionisDeterministic -
Added support for
db.listServicesoptionexcludeSystem
Collection API
-
Added collection
saveAll,updateAll,replaceAllandremoveAllmethodsThese methods replace the respective array versions of the collection methods
save,update,replaceandremove, which no longer accept arrays as inputs. -
Added
collection.documentIdmethodThe method takes a document or a document key and returns a fully qualified document ID string for the document in the current collection.
-
Added support for values
"ignore"and"conflict"inoverwriteModeoption when saving documents using the Collection API
Graph API
-
Added
graphVertexCollection.vertexExistsandgraphEdgeCollection.edgeExistsmethodsThese mimic the behavior of the
collection.documentExistsmethod but using the Graph API. -
Added
graphVertexCollection.collectionandgraphEdgeCollection.collectionThese properties now provide access to regular (non-graph) collection objects for these graph collections. These objects can be used to perform operations not available within the context of a graph (e.g. bulk imports or modifying the collection itself).
-
Added support for
isDisjointoption in Graph API
Cursor API
-
Added
cursor.flatMapmethodThis method behaves similarly to the
ArraymethodflatMapbut operates on the cursor directly likecursor.mapdoes. -
Added
cursor.batchesto provide a batch-wise cursor API -
Added support for
for awaitinArrayCursor(#616)It is now possible to use
for awaitto iterate over each item in a cursor asynchronously.
View API
- Added support for
primarySortCompressionandstoredValuesoptions in View API
Fixed
General
-
Removed TypeScript dependency on
domlibraryIf you are using arangojs in Node.js, you no longer need to add the
domlibrary to yourtsconfig.jsonconfiguration.
Database API
-
Fixed
db.dropFunctionoptiongroupbeing ignored -
Fixed documentation of
db.runServiceTestsPreviously the documentation incorrectly indicated that the default value of the
idiomaticoption istrue. The correct default value isfalse.
6.14.1 - 2020-05-01
Fixed
-
Added
uuidandpaddedto legalKeyGeneratorTypevalues in TypeScript (#656) -
Added
overwritetoInsertOptionstype in TypeScript (#657)
6.14.0 - 2020-03-18
Added
- Added
db.listTransactionsanddb.transactionsmethods
6.13.0 - 2020-01-24
Changed
-
Empty querystring parameters are now omitted
In some cases ArangoDB would be unable to correctly handle querystring parameters without values. Any paremeters set to
undefinedwill now no longer be added to the querystring.This does not affect parameters set to empty string values.
Added
- Added
maxRuntimeoption todb.querymethod
Fixed
-
Replaced
linkedlistdependency withx3-linkedlist(#601)The
linkedlistdependency had a memory leak and was no longer maintained. The replacement should fix this issue.
6.12.0 - 2019-10-16
Added
-
Added
cursor.killmethodCursors that have not yet been fully depleted can now be killed using the
cursor.killmethod. Note that this method has no effect if the cursor is already depleted. -
Added
cursor.nextBatchmethodCursors normally fetch additional batches as necessary while iterating over the individual results, this method allows consuming an entire batch at a time.
6.11.1 - 2019-08-30
Fixed
-
Fixed View properties not being passed correctly when creating Views (#621)
-
Renamed internal
response.hostattribute toresponse.arangojsHostId(#604)In some environments the
hostattribute is already present and read-only. This should avoid aTypeErrorbeing thrown when a value is assigned by arangojs.
6.11.0 - 2019-08-16
Changed
-
Renamed
db.transactiontodb.executeTransactionThe method for executing server-side transactions is now called
executeTransactionand theparamsargument now must be passed via theoptionsobject.For backwards-compatibility the new
db.transactionmethod will continue to behave like before when passed anactionstring as the second argument. Note that this behavior is deprecated and will be removed in arangojs 7.
Added
-
Added support for ArangoDB 3.5 streaming transactions
New streaming transactions can be created using
db.beginTransactionand existing streaming transactions can be accessed by passing the transaction ID todb.transaction.See the documentation of the
transaction.runmethod for examples of using streaming transactions with arangojs. -
Added support for ArangoDB 3.5 Analyzers API
See the documentation of the
db.analyzermethod and theAnalyzerinstances for information on using this API. -
Added
collection.getResponsibleShardmethod -
Added support for new ArangoDB 3.5 collection properties
-
Added support for new ArangoDB 3.5 View properties
Fixed
-
Fixed a problem causing empty nested AQL expressions to be converted to bind variables
Nesting an empty AQL expression like the result of calling
aql.joinwith an empty array would previously result in the AQL expression not being recognized and being converted to an object bind variable instead.
6.10.0 - 2018-12-22
Changed
-
Changed Views API to match 3.4 GA implementation
This release updates the Views API to the version implemented in the final ArangoDB 3.4 GA release. Please note that these changes may break code written for earlier ArangoDB 3.4 release candidates.
Added
-
Added
timeoutoption todb.queryand request methods (#572)Note that this merely cancels the request. Queries will still be executed and ArangoDB will still continue processing the request, this will merely result in the socket being forcefully disconnected.
-
Added query management API (#474)
This implements most endpoints of the HTTP Interface for AQL Queries.
6.9.0 - 2018-11-07
Changed
-
Restored support for credentials in URLs
If the server URL includes credentials, arangojs will now use them instead of the default username “root” and an empty password. Any credentials explicitly set using
useBasicAuthoruseBearerAuthwill still override the default credentials as before.
6.8.0 - 2018-11-07
Changed
-
Added
any[]to allowed types for AQL bind parametersThis should help in some cases where the previous TypeScript annotation was too restrictive.
Added
-
Added support for UNIX socket URLs (#405)
In addition to the
unix:///socket/pathandhttp+unix:///socket/pathURL formats recognized by ArangoDB, arangojs also supports the formathttp://unix:/socket/pathcommonly supported in the Node ecosystem and automatically converts ArangoDB endpoint URLs between them.
6.7.0 - 2018-10-24
Changed
-
No longer emitting
undefinedvalues inaqltemplate stringsPreviously using
undefinedvalues in an aql template string would result in a bind parameter being added with no value, which would always lead to an error response when ArangoDB executes the query. Now undefined values will simply be omitted, also easing the conditional insertion of query fragments. -
Changed experimental Views API
This release updates the experimental support for the Views API to the version implemented in the ArangoDB 3.4 release candidate. Please note that this API is still subject to change and may indeed still change until the 3.4.0 GA release.
-
Updated TypeScript to version 3
This may result in type signatures that are incompatible with TypeScript 2 being added in future releases (including patch releases).
Added
-
Added nesting support for
aqltemplate strings (#481)It is now possible to use aql queries as values in
aqltemplate strings:function createQuery(flowers, color) { const filter = color ? aql`FILTER flower.color == ${color}` : undefined; return aql`FOR flower IN ${flowers} ${filter} RETURN flower`; } createQuery(db.collection("flowers", "green")); // FOR flower IN @@value0 FILTER @value1 RETURN flower // {"@value0": "flowers", "value1": "green"} createQuery(db.collection("flowers")); // FOR flower IN @@value0 RETURN flower // {"@value0": "flowers"}Previously aql fragments could only be created with
aql.literal, which does not support bind parameters:aql.literal("FILTER flower.color == " + JSON.stringify(color)); // Note that we had to rely on JSON.stringify to correctly escape the value // because the value is part of the literal, not a bind parameter -
Added support for
undefinedand AQL literals toaql.literalPassing undefined to
aql.literalwill now result in an empty literal as would be expected. Passing an AQL literal back intoaql.literalwill return the existing literal rather than the string[object Object]. -
Added
aql.joinfunctionThe function
aql.joincan be used to convert an array ofaqlqueries into a combined query:const users = db.collection("users"); const keys = ["a", "b", "c"]; const fragments = keys.map((key) => aql`DOCUMENT(${users}, ${key})`); const combined = aql`[${aql.join(fragments, ", ")}]`; // [DOCUMENT(@@value0, @value1), DOCUMENT(@@value0, @value2), \ // DOCUMENT(@@value0, @value3)] // {"@value0": "users", "value1": "a", "value2": "b", "value3": "c"} const query = aql`FOR user IN ${combined} RETURN user.email`; // FOR user IN [DOCUMENT(@@value0, @value1), DOCUMENT(@@value0, @value2), \ // DOCUMENT(@@value0, @value3)] RETURN user.email // {"@value0": "users", "value1": "a", "value2": "b", "value3": "c"} -
Added
allowDirtyReadoption todb.queryandcollection.documentDirty reads are supported in leader/follower replication setups and require ArangoDB 3.4 or later. When performing a request that permits dirty reads, arangojs will load balance across all know leaders and followers and instruct ArangoDB to allow responding with stale or dirty response data. Note that data returned from a dirty read may be out of date or inconsistent.
6.6.0 - 2018-08-28
Changed
-
Re-implemented
collection.importThe previous implementation was broken. The new implementation should be backwards-compatible in cases where it previously wasn’t broken but is more flexible and also handles buffers.
Fixed
-
Added missing dependency on
@types/node(#567)This should solve TypeScript errors when the dependency was not already added.
6.5.1 - 2018-08-15
Fixed
-
Fixed
edgeCollection.savenot respecting options (#554) -
Fixed
db.createDatabaseTypeScript signature (#561)
6.5.0 - 2018-08-03
Changed
-
Requests that fail because a server can not be reached are now automatically retried if other servers are available
This behavior can be controlled using the
maxRetriesoption. -
Renamed
EdgeCollection#edgetoEdgeCollection#documentEdgeCollection#edgeis now an alias for thedocumentmethod. -
Renamed
GraphEdgeCollection#edgetoGraphEdgeCollection#documentGraphEdgeCollection#edgeis now an alias for thedocumentmethod. -
Renamed
GraphVertexCollection#vertextoGraphVertexCollection#documentGraphVertexCollection#vertexis now an alias for thedocumentmethod.
Added
-
Added
maxRetriesoption to configuration to control retry behavior -
Added
collection.documentExistsmethod -
Added
gracefuloption tocollection.document
6.4.0 - 2018-07-06
Changed
- Added TypeScript validation for
optsinDocumentCollection#save
Added
-
Added
ArangoErrorandCollectionTypeto public exports -
Added
db.closemethod -
Added
optsparameter toEdgeCollection#save
6.3.0 - 2018-06-20
Added
-
Added
db.versionmethod -
Added
db.loginmethod -
Added
db.existsmethod -
Added
collection.existsmethod -
Added
graph.existsmethod -
Added
aql.literalfunction -
Exposed typings for collections and graphs (@samrg472 in #538)
Fixed
-
Fixed synchronous errors during request creation not being handled
Internal errors thrown while a request is created (e.g. malformed URIs) would result in unhandled errors, which could result in termination of the process or promises never being rejected. These errors are now handled normally and will result in async rejections as expected.
6.2.4 - 2018-04-27
Fixed
- Ensure
res.bodyis an empty string instead of null in the browser version
6.2.3 - 2018-04-03
Fixed
-
Fixed
collection.update(documentHandle, newValue, opts)missing return value -
Fixed
collection.removeByKeys(keys, options)missing return value -
Fixed
collection.replaceByExample(example, newValue, opts)missing return value -
Fixed
collection.updateByExample(example, newValue, opts)missing return value
6.2.2 - 2018-03-21
Fixed
-
Replaced
Object.valuesuse to improve Node version compatibilityThis allows using arangojs in Node.js 6 LTS without a polyfill.
6.2.1 - 2018-03-21
Changed
-
Moved most documentation out of the README (#123)
This is a necessary step to integrate arangojs with the Drivers book in the official ArangoDB documentation.
-
Replaced internal use of async functions with callbacks
This removes some unnecessary layers of indirection, which should increase overall performance.
Fixed
- Increased test coverage (#34).
6.2.0 - 2018-03-06
Changed
-
Extended
db.transactionarguments (@f5io in #494)It’s now possible to pass additional transaction options.
Fixed
-
Fixed a typo (@lodestone in #506)
-
Fixed
graphEdgeCollection.edgereturn value (@Hunter21007 in #501) -
Fixed graph API sending incorrect requests resulting in HTTP 400 errors (@casdevs in #513)
6.1.0 - 2018-02-12
Removed
-
Removed ES modules build
This should solve compatibility problems with
es6-error. The cjs build now should also work with emulated ES module imports.
Changed
-
Use
cpy-clifor build processShould help with cross-platform compatibility.
Fixed
-
Fixed
db.uninstallService(mount, opts)opts default value -
Fixed
db.getServiceConfiguration(mount, minimal)minimal representation -
Fixed
db.getServiceDependencies(mount, minimal)minimal representation -
Fixed
db.updateServiceConfiguration(mount, cfg, minimal)non-minimal representation -
Fixed
db.replaceServiceConfiguration(mount, cfg, minimal)non-minimal representation -
Fixed
db.updateServiceDependencies(mount, cfg, minimal)non-minimal representation -
Fixed
db.replaceServiceDependencies(mount, cfg, minimal)non-minimal representation -
Fixed handling of non-json responses
6.0.1 - 2018-01-22
Changed
-
Use
rimraffor build processShould help with cross-platform compatibility.
Fixed
-
Fixed some imports broken during the TypeScript rewrite
If you were previously seeing errors involving a
defaultproperty, this should make those go away.
6.0.0 - 2018-01-11
Removed
-
Removed
retryConnectionconfig.It is not possible to reliably determine whether retrying a request is safe or not at the driver level. If you need automatic retry, you should implement your own logic, e.g. using the retry package.
-
Removed
promiseconfig.If you want to use an alternative promise implementation you need to overwrite the
Promiseglobal variable directly. -
Asynchronous functions no longer support node-style callbacks.
All asynchronous functions now return promises.
-
Removed support for credentials in
urlconfig.Use
db.useBasicAuthordb.useBearerAuthto pass credentials instead. -
Removed bower support.
Use yarn/npm instead.
Changed
-
Removed
libpath prefixAll arangojs files can now be imported directly by name.
Before:
import { DocumentCollection } from "arangojs/lib/collection";After:
import { DocumentCollection } from "arangojs/collection"; -
The
urlconfig can now also be an array of URLs.The behavior depends on the load balancing strategy (see API docs).
-
The
databaseNameconfig has been replaced withisAbsolute.If you previously used
databaseName: false, the same behavior can now be achieved usingisAbsolute: true. If you want to use a specific database you can still switch databases withdb.useDatabaseat any time. -
Browser: maximum number of parallel connections behaves differently.
As keep-alive does not work reliably in the browser, the maximum number of parallel connections now matches
agentOptions.maxSocketsexactly. -
TypeScript: ported arangojs to TypeScript.
The generated typings are now included in the NPM release and should be more reliable than the community maintained typings included with earlier versions of arangojs. See also #480.
Added
-
Added ES Modules and browser build to NPM release.
- ES Modules files live under
lib/esm/ - CommonJS files live under
lib/cjs/ - Precompiled browser build lives at
lib/web.js
- ES Modules files live under
-
Added support for load balancing and failover.
See API documentation for details.
-
Added
acquireHostListmethod.See API documentation for details.
-
Added support for leader/follower failover.
Connections to a follower responding with an endpoint redirect will now be transparently redirected to the indicated leader.
Fixed
-
Fixed #354
Graph methods now only return the relevant part of the response body.