v10.0.0-alpha.0
Pre-releaseThis 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
-
Changed
QueueTimeMetricstype to an interface -
Changed
CursorExtrasandCursorStatsinterfaces to types -
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.
-
Renamed
db.listServiceScriptsmethod todb.getServiceScripts -
Renamed
db.listHotBackupsmethod todb.getHotBackups -
Renamed
db.getLogMessagesmethod todb.listLogMessages -
Renamed
db.listFunctionsmethod todb.listUserFunctions -
Renamed
db.createFunctionmethod todb.createUserFunction -
Renamed
db.dropFunctionmethod todb.dropUserFunction -
Changed
db.removeUsermethod to returnvoid
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 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.
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 dropped from
ArangosearchIndexDescription
to more accurately reflect the index type name. The index type still refers
to an internal index, however. -
Renamed various types for consistency:
-
AqlUserFunction->UserFunctionDescription -
CollectionMetadata->CollectionDescription -
DatabaseInfo->DatabaseDescription -
GraphInfo->GraphDescription -
ServiceInfo->ServiceDescription -
QueryInfo->QueryDescription -
QueryTracking->QueryTrackingInfo -
TransactionDetails->TransactionInfo -
TransactionCollections->TransactionCollectionOptions -
CreateDatabaseUser->CreateDatabaseUserOptions -
Index operations:
IndexListOptions->ListIndexesOptions
-
Collection document operations:
DocumentExistsOptions->DocumentExistsOptionsCollectionReadOptions->ReadDocumentOptionsCollectionBatchReadOptions->BulkReadDocumentsOptionsCollectionInsertOptions->InsertDocumentOptionsCollectionReplaceOptions->ReplaceDocumentOptionsCollectionUpdateOptions->UpdateDocumentOptionsCollectionRemoveOptions->RemoveDocumentOptionsCollectionImportOptions->ImportDocumentsOptionsCollectionEdgesOptions->DocumentEdgesOptionsCollectionImportResult->ImportDocumentsResultCollectionEdgesResult->DocumentEdgesResult
-
Graph collection document operation:
GraphCollectionReadOptions->ReadGraphDocumentOptionsGraphCollectionInsertOptions->CreateGraphDocumentOptionsGraphCollectionReplaceOptions->ReplaceGraphDocumentOptionsGraphCollectionRemoveOptions->RemoveGraphDocumentOptionsViewPatchPropertiesOptions->UpdateViewPropertiesOptions
-
View operations:
ArangoSearchViewPatchPropertiesOptions->UpdateArangoSearchViewPropertiesOptionsSearchAliasViewPatchPropertiesOptions->UpdateSearchAliasViewPropertiesOptionsSearchAliasViewPatchIndexOptions->UpdateSearchAliasViewIndexOptionsArangoSearchViewStoredValueOptions->CreateArangoSearchViewStoredValueOptions
-
-
Renamed
ArrayCursorandBatchedArrayCursorclasses toCursorand
BatchCursorrespectivelyThe 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
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.
Added
-
Added
BatchCursor#itemsViewproperty andBatchCursorItemsViewinterfaceThis property provides a low-level interface for consuming the items of the
cursor and is used by the regular item-wiseCursorclass internally. -
Added
onErroroption toConfig(DE-955)This option can be used to specify a callback function that will be invoked
whenever a request results in an error. UnlikeafterResponse, 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
NetworkErrorclassThis is the common base class for all errors (including
HttpError) that
occur while making a request. The originating error can be accessed using the
causeproperty. The request object can be accessed using therequest
property.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 thecauseproperty of the originating error, i.e. thecause
property 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 the
causeproperty. This error is only thrown whendb.waitForPropagation
is invoked with atimeoutoption and the timeout duration is exceeded. -
Added
ProcessedResponsetypeThis type replaces the previously internal
ArangojsResponsetype and
extends the nativeResponsetype with additional properties. -
Added optional
ArangoError#requestpropertyThis property is always present if the error has a
responseproperty. In
normal use this should always be the case.