Skip to content

Releases: arangodb/arangojs

v7.5.0

22 Apr 17:53
2c41d75
Compare
Choose a tag to compare

Added

  • Added support for new ArangoDB 3.8 Analyzer types

    This adds the PipelineAnalyzer, AqlAnalyzer, GeoJsonAnalyzer,
    GeoPointAnalyzer and StopwordsAnalyzer types in TypeScript, as well as
    the Analyzer-specific properties types.

  • Added support for new ArangoDB 3.8 estimates option for indexes

    This affects the PersistentIndex, HashIndex and SkiplistIndex types
    in TypeScript.

v7.5.0-preview-arangodb.3.8

09 Apr 14:38
213cc59
Compare
Choose a tag to compare
Pre-release

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.

Added

  • Added support for new ArangoDB 3.8 Analyzer types

    This adds the PipelineAnalyzer, AqlAnalyzer, GeoJsonAnalyzer,
    GeoPointAnalyzer and StopwordsAnalyzer types in TypeScript, as well as
    the Analyzer-specific properties types.

  • Added support for new ArangoDB 3.8 estimates option for indexes

    This affects the PersistentIndex, HashIndex and SkiplistIndex types
    in TypeScript.

v7.4.0

09 Apr 14:38
26c8f41
Compare
Choose a tag to compare

Added

  • Implemented toJSON methods for ArangoError and HttpError (#632)

    This prevents an error where JSON.stringify would reliably throw if passed
    an instance of either of these error types generated by arangojs. Note that
    you may still want to implement your own JSON representation logic as system
    errors (e.g. ECONNREFUSED) are not wrapped by arangojs and thrown as-is.

Fixed

  • Stack traces are now improved for most errors when using precaptureStackTraces (#722)

    Previously this option would only affect network errors, making it far less
    useful than intended. Now parsing errors, ArangoError instances and HTTP
    errors also receive improved error stack traces when this option is enabled.

  • Improved performance for precaptureStackTraces when no errors occur

    The generated stack is now only accessed on demand, allowing the runtime to
    delay generation of the stack trace string. Previously the stack would always
    be accessed prior to the request being sent, causing a noticeable delay even
    when no error occurs.

  • Fixed document selector validation in collection.edges and its variants (#704)

    These methods previously only permitted start vertices that are documents
    within the edge collection itself. This behavior has now been corrected to
    permit start vertices outside the collection, as expected.

v7.3.0

08 Mar 15:25
d5d8301
Compare
Choose a tag to compare

Changed

  • Changed the default for agentOptions.scheduling to "lifo"

    This is already the default in Node v15.6 but can reduce latency caused by
    sockets expiring, especially with larger connection pools and infrequent
    requests.

  • Removed keepAlive-specific throughput optimization

    Previously arangojs would allow agentOptions.maxSockets * 2 concurrent
    requests, to optimize socket reuse by avoiding idle time. This behavior
    could trigger deadlocks when attempting to perform multiple transactions
    in parallel and only marginally improved throughput in some high-load
    scenarios. The connection pool size now always reflects the value set in
    agentOptions.maxSockets regardless of whether keepAlive is enabled.

  • Changed agentOptions.maxSockets default value when using ROUND_ROBIN

    As the connection pool is shared across all server connections when using
    ROUND_ROBIN load balancing, the default value of 3 is too limiting for
    most scenarios involving multiple coordinators. When passing multiple URLs
    via the url option and specifying ROUND_ROBIN load balancing, arangojs
    will now default this value to url.length * 3 instead.

v7.2.0

02 Dec 17:05
b79ff48
Compare
Choose a tag to compare

Added

  • Added db.waitForPropagation method

    This method helps with setting up databases in a cluster scenario by waiting
    for a request to succeed on every known coordinator.

v7.1.1

30 Nov 14:11
ef4b296
Compare
Choose a tag to compare

This is a maintenance release and contains no bugfixes or features.

v7.1.0

16 Oct 15:11
41d5f93
Compare
Choose a tag to compare

Changed

  • Killing a cursor now also drains it locally

Fixed

  • Fixed a potential memory leak in cursor batch handling

v7.0.2

25 Sep 10:17
f9d1f4a
Compare
Choose a tag to compare

Fixed

  • Fixed incorrect HTTP method call in patch method (#687)

  • Fixed empty query results containing [undefined] (#683)

  • Fixed updateByExample and replaceByExample new value parameter name

    Note that these methods are still deprecated. Previously the newValue
    parameter was incorrectly called newData, which prevented the methods from
    working at all.

v7.0.1

21 Aug 13:23
e588fc4
Compare
Choose a tag to compare

This is a maintenance release because the initial v7 release did not include
a README file.

v7.0.0

21 Aug 13:23
236786d
Compare
Choose a tag to compare

This is a major release and breaks backwards compatibility.

See the migration guide for detailed instructions
for upgrading your code to arangojs v7.

For a detailed list of changes between pre-release versions of v7 see the
Changelog of the final v7 release candidate.

Removed

General

  • Removed ArangoDB 2.8 support

    ArangoDB 2.8 has reached End of Life since mid 2018. Version 7 and above
    of arangojs will no longer support ArangoDB 2.8 and earlier.

  • Removed Node.js 6/8 support

    As of version 7 arangojs now requires language support for async/await.
    This means arangojs requires Node.js 10 (LTS) or newer to function correctly.

  • Removed support for absolute endpoint URLs

    This removes the isAbsolute option from the arangojs configuration.

  • Removed ArangoError re-export

    The type can still be imported directly from the error module.

  • Removed statusCode properties of ArangoError and HttpError

    Both of these error types still expose the HTTP status code as the code
    property. For ArangoError the true HTTP status code may be different and
    can still be accessed using the response.statusCode property.

Database API

  • Removed db.edgeCollection method

    As arangojs 7 uses the same implementation for document and edge collections,
    this method is no longer necessary. Generic collection objects can still be
    cast to DocumentCollection or EdgeCollection types in TypeScript.

  • Removed db.truncate convenience method

    This was a wrapper around db.listCollections and collection.truncate.
    The behavior of db.truncate can still be emulated by calling these methods
    directly.

Collection API

  • Removed collection createCapConstraint, createHashIndex,
    createSkipList, createPersistentIndex, createGeoIndex and
    createFulltextIndex methods

    These methods are no longer part of the official ArangoDB API and can be
    replaced by using the collection.ensureIndex method.

  • Removed save(fromId, toId, edgeData) method variants

    Methods for creating edges now require the _to and _from attributes to
    be specified in the edge (document) data and no longer accept these values
    as positional arguments.

  • Removed collection.bulkUpdate method

    The new method collection.updateAll now provides this functionality.

  • Removed collection.edge method

    This method was previously an alias for collection.document.

    The method graphEdgeCollection.edge is unaffected by this change.

  • Removed graphName option for edgeCollection.traversal

    Graph traversals can still be performed via graph.traversal.

Graph API

  • Removed generic collection methods from GraphVertexCollection

    All methods that are not part of the graph API have been removed.
    The underlying collection can still be accessed from the collection
    property.

  • Removed generic collection methods from GraphEdgeCollection

    All methods that are not part of the graph API have been removed.
    The underlying collection can still be accessed from the collection
    property.

Cursor API

  • Removed cursor.some and cursor.every methods

    These methods encouraged overfetching and should be replaced with more
    efficient AQL queries.

    The behavior can still be implemented by using the next method directly
    or iterating over the cursor using the forEach method or the for await
    syntax.

View API

  • Removed ViewResponse type

    The type ViewDescription represents the same structure.

  • Removed ArangoSearchViewPropertiesResponse type

    The type ArangoSearchViewProperties & ViewDescription can be used
    to represent the same structure.

Deprecated

Database API

  • Deprecated db.useDatabase method

    Using this method will affect Collection, Graph and other objects
    already created for the given database and change which database these
    refer to, which may cause unexpected behavior.

    As of arangojs 7 the db.database method can be used instead to create a
    new, separate Database object using the same connection pool.

Collection API

  • Deprecated Collection methods for simple queries: list, all, any,
    byExample, firstExample, removeByExample, replaceByExample,
    updateByExample, lookupByKeys, removeByKeys, fulltext

    These methods were deprecated in ArangoDB 3.4 and should no longer be used.
    They will still behave correctly with versions of ArangoDB supporting these
    methods but may be removed in a future ArangoDB release.

    Their behavior can be emulated using AQL queries.

Graph API

  • Deprecated graph.traversal and collection.traversal

    These methods were deprecated in ArangoDB 3.4 and should no longer be used.
    They will still behave correctly with versions of ArangoDB supporting these
    methods but may be removed in a future ArangoDB release.

    Their behavior can be emulated using AQL graph traversal.

Changed

General

  • Multiple Database objects can now share a single Connection

    All arangojs objects now reference a Database object rather than accessing
    the underlying Connection directly. This allows multiple Database objects
    to be created by using the db.database method while still allowing the
    creation of separate database objects with separate connection pools if
    desired.

  • Memoized Database, Collection, Graph, View and Analyzer

    Database objects are now memoized per-connection and the other object types
    are memoized per-database. Using useDatabase de-memoizes the database
    object to prevent unexpected behavior.

  • Added support for View in aql templates (#667)

    View (or ArangoSearchView) objects can now be passed into aql templates
    like ArangoCollection objects.

  • Moved collectionToString helper into collection module

  • Moved Dict type into connection module

  • Moved Patch type into documents module

  • Removed Errback type from public API

  • Renamed util/foxx-manifest module to foxx-manifest

Database API

  • Renamed method db.arangoSearchView to db.view

  • Renamed method db.createArangoSearchView to db.createView

  • Replaced methods db.enableServiceDevelopmentMode and
    db.disableServiceDevelopmentMode with db.setServiceDevelopmentMode

  • Flattened database query method options argument

    The optional options argument previously contained an additional options
    object with additional query options. These options are now specified on the
    options argument itself directly.

    Before:

    db.query(aql`FOR doc IN ${collection} RETURN doc`, {
      cache: false,
      options: { fullCount: true },
    });

    After:

    db.query(aql`FOR doc IN ${collection} RETURN doc`, {
      cache: false,
      fullCount: true,
    });
  • Changed db.listServices option excludeSystem default to true

    To be more consistent with the equivalent options in other methods,
    the default value has been changed from false to true.

  • Changed db.createDatabase return type to Database

  • Renamed database.setQueryTracking to database.queryTracking

    The method will now return the existing query tracking properties or set the
    new query tracking properties depending on whether an argument is provided.

  • Method db.transaction no longer acts as an alias for executeTransaction

    The method now only allows looking up transactions by ID. Previously it would
    wrap executeTransaction if passed the arguments expected by that method.

Collection API

  • Merged DocumentCollection and EdgeCollection APIs

    All collections are now implemented as generic Collection objects.
    In TypeScript the generic collection object can still be explicitly cast to
    DocumentCollection or EdgeCollection for stricter type safety.

  • Renamed collection.setProperties to collection.properties

    The method will now return the existing properties or set the properties
    depending on whether an argument is provided.

  • Removed CollectionMetadata fields from CollectionProperties type

    Methods that previously returned CollectionProperties now return
    CollectionMetadata & CollectionProperties.

  • Collection methods save, update, replace and remove no longer take
    arrays as input

    The array versions have been renamed to saveAll, updateAll, replaceAll
    and removeAll to reduce the likelihood of mistakes and provide more helpful
    type signatures.

  • Collection methods will now throw errors when passed documents or document
    IDs from different collections where a document key or ID for a document in
    the same collection is expected

    For example the following code will now result in an error rather than the
    document from a different collection being returned:

    const aliceId = "alice/123"; // Document from collection "alice"
    const bobCol = db.collection("bob"); // Collection "bob"
    const doc = await bobCol.document(aliceId); // THROWS
  • Changed collection.import option type behavior

    Previously this option would always default to "auto".

    When passing a string, Buffer or Blob as data, the option now defaults
    to undefined. This matches the behavior in previous versions of setting
    the option explicitly to null.

    Additionally, the value "array" has been replaced with "list".

    When passing an array as data, the option is now no longer supported as the
    corresponding value will be inferred from the arra...

Read more