Skip to content

Releases: arangodb/arangojs

v6.13.0

24 Jan 14:31
835aa66
Compare
Choose a tag to compare

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 undefined will now
    no longer be added to the querystring.

    This does not affect parameters set to empty string values.

Added

  • Added maxRuntime option to db.query method

Fixed

  • Replaced linkedlist dependency with x3-linkedlist (#601)

    The linkedlist dependency had a memory leak and was no longer maintained.
    The replacement should fix this issue.

v6.12.0

18 Oct 13:09
a034e46
Compare
Choose a tag to compare

Added

  • Added cursor.kill method

    Cursors 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 method

    Cursors 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

18 Oct 13:09
9d93dcd
Compare
Choose a tag to compare

Fixed

  • Fixed view properties not being passed correctly when creating views (#621)

  • Renamed internal response.host attribute to response.arangojsHostId (#604)

    In some environments the host attribute is already present and read-only.
    This should avoid a TypeError being thrown when a value is assigned by
    arangojs.

v6.11.0

18 Oct 13:08
b085a35
Compare
Choose a tag to compare

Changed

  • Renamed db.transaction to db.executeTransaction

    The method for executing server-side transactions is now called
    executeTransaction and the params 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 an action 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
    to db.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 the Analyzer
    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

18 Oct 13:08
4d62395
Compare
Choose a tag to compare

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 to db.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

08 Nov 10:03
851400f
Compare
Choose a tag to compare

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 useBasicAuth or useBearerAuth will still override the default
    credentials as before.

v6.8.0

08 Nov 10:02
216efd9
Compare
Choose a tag to compare

Changed

  • Added any[] to allowed types for AQL bind parameters

    This 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 and http+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

08 Nov 10:02
daa370f
Compare
Choose a tag to compare

Changed

  • No longer emitting undefined values in aql template strings

    Previously 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 to aql.literal

    Passing undefined to aql.literal will now result in an empty literal as
    would be expected. Passing an AQL literal back into aql.literal will return
    the existing literal rather than the string [object Object].

  • Added aql.join function

    The function aql.join can be used to convert an array of aql 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 to db.query and collection.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

27 Aug 22:49
264ff8c
Compare
Choose a tag to compare

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.

v6.5.1

27 Aug 22:50
c47b43b
Compare
Choose a tag to compare

Fixed

  • Fixed edgeCollection.save not respecting options (#554)

  • Fixed database.createDatabase TypeScript signature (#561)