Releases: arangodb/arangojs
v6.13.0
Changed
-
Empty querystring parameters are now omitted
In some cases ArangoDB would be unable to correctly handle querystring
parameters without values. Any paremeters set toundefinedwill 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.
v6.12.0
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.
v6.11.1
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.
v6.11.0
Changed
-
Renamed
db.transactiontodb.executeTransactionThe method for executing server-side transactions is now called
executeTransactionand theparamsargument now must be passed via the
optionsobject.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
database.analyzermethod and theAnalyzer
instances 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 recognised and being
converted to an object bind variable instead.
v6.10.0
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 https://docs.arangodb.com/3.4/HTTP/AqlQuery/.
v6.9.0
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 usinguseBasicAuthoruseBearerAuthwill still override the default
credentials as before.
v6.8.0
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/path
URL formats recognized by ArangoDB, arangojs also supports the format
http://unix:/socket/pathcommonly supported in the Node ecosystem and
automatically converts ArangoDB endpoint URLs between them.
v6.7.0
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.
v6.6.0
Changed
-
Reimplemented
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.