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 toundefined
will now
no longer be added to the querystring.This does not affect parameters set to empty string values.
Added
- Added
maxRuntime
option todb.query
method
Fixed
-
Replaced
linkedlist
dependency withx3-linkedlist
(#601)The
linkedlist
dependency had a memory leak and was no longer maintained.
The replacement should fix this issue.
v6.12.0
Added
-
Added
cursor.kill
methodCursors that have not yet been fully depleted can now be killed using the
cursor.kill
method. Note that this method has no effect if the cursor
is already depleted. -
Added
cursor.nextBatch
methodCursors 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.host
attribute toresponse.arangojsHostId
(#604)In some environments the
host
attribute is already present and read-only.
This should avoid aTypeError
being thrown when a value is assigned by
arangojs.
v6.11.0
Changed
-
Renamed
db.transaction
todb.executeTransaction
The method for executing server-side transactions is now called
executeTransaction
and theparams
argument now must be passed via the
options
object.For backwards-compatibility the new
db.transaction
method will continue to
behave like before when passed anaction
string 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.beginTransaction
and
existing streaming transactions can be accessed by passing the transaction ID
todb.transaction
.See the documentation of the
transaction.run
method for examples of using
streaming transactions with arangojs. -
Added support for ArangoDB 3.5 Analyzers API
See the documentation of the
database.analyzer
method and theAnalyzer
instances for information on using this API. -
Added
collection.getResponsibleShard
method -
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.join
with 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
timeout
option todb.query
and 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 usinguseBasicAuth
oruseBearerAuth
will 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/path
andhttp+unix:///socket/path
URL formats recognized by ArangoDB, arangojs also supports the format
http://unix:/socket/path
commonly supported in the Node ecosystem and
automatically converts ArangoDB endpoint URLs between them.
v6.7.0
Changed
-
No longer emitting
undefined
values inaql
template stringsPreviously using
undefined
values 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
aql
template strings (#481)It is now possible to use aql queries as values in
aql
template 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
undefined
and AQL literals toaql.literal
Passing undefined to
aql.literal
will now result in an empty literal as
would be expected. Passing an AQL literal back intoaql.literal
will return
the existing literal rather than the string[object Object]
. -
Added
aql.join
functionThe function
aql.join
can be used to convert an array ofaql
queries 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
allowDirtyRead
option todb.query
andcollection.document
Dirty 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.import
The 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.