Releases: arangodb/arangojs
v8.4.1
v8.4.0
Changed
-
Fetching additional cursor results now uses
POSTinstead ofPUT(DE-605)The
POSTroute was deprecated and thePUTroute 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 by
db.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 })); });
v8.3.1
v8.3.0
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.
v8.2.1
v8.2.0
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 anIndexSelectorwill 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.
v8.1.0
v8.0.0
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
defaults
list 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 thecollectionsub-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 atransform
callback 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 bundlearangojs/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(); 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.getUserDatabases
to match documented return types -
Retry requests resulting in status 503
ArangoError(#710)Unless retries are explicitly disabled by setting
config.maxRetriesto
false, 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
CreateArangoSearchViewfrom
ArangoSearchViewPropertiesOptionsNote 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 of
CreateAnalyzerOptionsandAnalyzerDescriptiontypes. -
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 wayArangoErrorand
HttpErrorobjects 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 toEnsureGeoIndexOptions
andGeoIndextypesGeo indexes created in ArangoDB pre-3.10 will implicitly default this option
totrue. 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,classificationand
nearest_neighborsAnalyzer types -
Added missing
replicationFactorandwriteConcernoptions to
CollectionPropertiesOptionstype -
Added missing
commitIntervalMsecoption toArangoSearchViewProperties
type -
Added missing
deduplicateoption toEnsurePersistentIndexOptionstype
(#771) -
Added missing
uniqueoption toEnsureZkdIndexOptionstype -
Added missing
deduplicateandestimatesfields to...
v8.0.0-rc.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 or yarn add arangojs@next.
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 support
As of version 8 arangojs no longer maintains compatibility for IE11 in the
pre-built browser bundle. You may still be able to use arangojs in IE11 when
bundling arangojs yourself but this may require polyfills and transformation. -
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
BytesAccumConsolidationPolicytypeThe
bytes_accumconsolidation policy for views was deprecated in
ArangoDB 3.7 and should be replaced with thetierconsolidation policy. -
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 thecollectionsub-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 atransform
callback 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 bundlearangojs/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(); 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.getUserDatabases
to match documented return types -
Retry requests resulting in status 503
ArangoError(#710)Unless retries are explicitly disabled by setting
config.maxRetriesto
false, 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
CreateArangoSearchViewfrom
ArangoSearchViewPropertiesOptionsNote 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 of
CreateAnalyzerOptionsandAnalyzerDescriptiontypes. -
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.
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 wayArangoErrorand
HttpErrorobjects 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 toEnsureGeoIndexOptions
andGeoIndextypesGeo indexes created in ArangoDB pre-3.10 will implicitly default this option
totrue. 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,classificationand
nearest_neighborsAnalyzer types -
Added missing
replicationFactorandwriteConcernoptions to
CollectionPropertiesOptionstype -
Added missing
commitIntervalMsecoption toArangoSearchViewProperties
type -
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 likeViewand
ArangoCollectionobjects.