UNPKG

67.7 kBMarkdownView Raw
1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
8This driver uses semantic versioning:
9
10- A change in the bugfix version (e.g. X.Y.0 -> X.Y.1) indicates internal
11 changes and should always be safe to upgrade.
12- A change in the minor version (e.g. X.1.Z -> X.2.0) indicates additions and
13 backwards-compatible changes that should not affect your code.
14- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
15 changes that require changes in your code to upgrade.
16
17## [9.0.0] - 2024-07-31
18
19This is a major release and breaks backwards compatibility.
20
21See [the migration guide](./MIGRATING.md#v8-to-v9) for detailed instructions
22for upgrading your code to arangojs v9.
23
24### Removed
25
26- Removed Node.js 14 and Node.js 16 support
27
28 With Node.js 14 and 16 having reached their end of life, arangojs will no
29 longer support these versions of Node.js going forward.
30
31 For more information, see [the Node.js release schedule](https://nodejs.dev/en/about/releases/).
32
33- Removed `Params` and `Headers` types
34
35 These can mostly be replaced with the native `URLSearchParams` and `Headers`
36 types but most public methods still accept the equivalent `Record` types for
37 convenience.
38
39- Removed deprecated `FulltextIndex` and related types
40
41 Fulltext indexes have been deprecated in ArangoDB 3.10 and should be replaced
42 with ArangoSearch.
43
44- Removed browser build
45
46 The browser build has been removed from the repository and will no longer be
47 published to npm. The npm package can still be used in the browser by using
48 common frontend tooling like webpack or rollup.
49
50- Removed `Collection` methods for simple queries: `list`, `all`, `any`,
51 `byExample`, `firstExample`, `removeByExample`, `replaceByExample`,
52 `updateByExample`, `lookupByKeys`, `removeByKeys`, `fulltext`
53
54 Simple queries were deprecated in ArangoDB 3.4 and can be replicated with AQL.
55
56### Changed
57
58- Replaced request logic with native `fetch` API ([#788](https://github.com/arangodb/arangojs/issues/788), DE-578, DE-758)
59
60 The node-specific request logic using the `http` and `https` modules has been
61 replaced with all-new logic using the web standard `fetch` API, which should
62 work in Node.js, browsers and other conformant environments.
63
64- Unicode names are now **no longer** automatically NFC normalized (DE-65)
65
66 This change affects all database, collection, graph, view and analyzer names
67 using unicode characters. Starting with arangojs v7.7.0 these names were
68 automatically NFC normalized. This behavior has now been reverted to match
69 the behavior of other ArangoDB drivers and help detect normalization issues
70 in user code.
71
72- Changed return type of `aql` and the AQL `join` helper function to `AqlQuery`
73
74 Previously the internal `GeneratedAqlQuery` type was exposed as the return
75 type of these functions, leading to complexity when handling generic type
76 arguments.
77
78- Removed dependency on Node `path` module or its browserify equivalent
79
80 This change should be backwards-compatible but may produce different results
81 when using non-normalized paths and base-paths in custom `routes`. This
82 should help support more environments and reduce the size of the browser
83 bundle.
84
85- Inlined `x3-linkedlist` dependency
86
87 Inlining this dependency should help make arangojs more portable.
88
89- Split the Collection type parameter into result and input types ([#807](https://github.com/arangodb/arangojs/issues/807))
90
91 It is now possible to specify a separate type for the data passed when
92 creating or modifying documents in addition to the type of the data returned
93 when fetching documents. This allows excluding computed properties from
94 the input type while still including them in the result type.
95
96### Added
97
98- Added ESM support (DE-236)
99
100 The driver now supports being imported as an ES module or CommonJS module
101 and provides exports for both types of environments. This change should be
102 backwards-compatible.
103
104- Added support for `withHidden` option in `collection.indexes`
105
106 This option was introduced in ArangoDB 3.10.13 and 3.11.7 and allows
107 fetching the progress information of indexes that are in the building phase.
108
109- Added support for `withStats` option in `collection.indexes`
110
111 This method now takes an object with `withStats` and `withHidden` options
112 instead of a boolean flag.
113
114- Added readonly `Job#id` property
115
116 This property was not previously exposed.
117
118- Added `skipFastLockRound` option for streaming transactions
119
120 This option was introduced in 3.12.1 and allows skipping the fast lock round.
121
122- Added non-specific `EnsureIndexOptions` type and `ensureIndex` method
123 signature ([#778](https://github.com/arangodb/arangojs/issues/778))
124
125 This allows creating indexes without narrowing the index type.
126
127## [8.8.1] - 2024-03-20
128
129### Added
130
131- Added the `versionAttribute` option to the document operation options types (DE-783)
132
133## [8.8.0] - 2024-03-12
134
135### Changed
136
137- Renamed ZKD index type to MDI (DE-744)
138
139 The ZKD index type was previously marked as experimental and has now been
140 finalized and renamed to MDI in ArangoDB 3.12.
141
142- Added `DocumentOperationMetadata` and `DocumentOperationFailure` types (DE-693)
143
144 The return types of document and edge operations on collections have been
145 modified to correctly represent the return values of bulk operations and
146 single document/edge operations using the `overwriteMode` option.
147
148### Deprecated
149
150- Deprecated active failover support (DE-746)
151
152 Active failover is no longer be supported in ArangoDB 3.12 and later. This
153 functionality will be removed from the driver in a future release.
154
155### Added
156
157- Added support for `multi_delimiter` analyzer type (DE-753)
158
159- Added support for `wildcard` analyzer type (DE-750)
160
161## [8.7.0] - 2024-02-14
162
163### Changed
164
165- Made `options` argument in `collection.edges`, `inEdges` and `outEdges` optional ([#802](https://github.com/arangodb/arangojs/issues/802))
166
167### Deprecated
168
169- Deprecated `db.getLogMessages`
170
171 This API was deprecated in ArangoDB 3.8 and should no longer be used.
172 Use `db.getLogEntries` instead.
173
174### Fixed
175
176- Fixed `db.getLogEntries` using the wrong API endpoint
177
178## [8.6.0] - 2023-10-24
179
180### Added
181
182- Added `db.createJob` method to convert arbitrary requests into async jobs (DE-610)
183
184 This method can be used to set the `x-arango-async: store` header on any
185 request, which will cause the server to store the request in an async job:
186
187 ```js
188 const collectionsJob = await db.createJob(() => db.collections());
189 // once loaded, collectionsJob.result will be an array of Collection instances
190 const numbersJob = await db.createJob(() =>
191 db.query(aql`FOR i IN 1..1000 RETURN i`)
192 );
193 // once loaded, numbersJob.result will be an ArrayCursor of numbers
194 ```
195
196## [8.5.0] - 2023-10-09
197
198### Added
199
200- Implemented hot backup API (DE-576)
201
202- Implemented logging API (DE-144, DE-145, DE-146, DE-147)
203
204- Implemented async jobs management (DE-339)
205
206- Added `db.shutdown` to initiate a clean shutdown of the server
207
208- Added `db.time` method to retrieve the server's system time
209
210## [8.4.1] - 2023-09-15
211
212### Fixed
213
214- Fixed default return type of AQL queries being `undefined` instead of `any` ([#797](https://github.com/arangodb/arangojs/issues/797))
215
216## [8.4.0] - 2023-07-10
217
218### Changed
219
220- Fetching additional cursor results now uses `POST` instead of `PUT` (DE-605)
221
222 The `PUT` route was deprecated and the `POST` route is supported in all
223 actively maintained versions of ArangoDB.
224
225- User management methods now use database-relative URLs (DE-606)
226
227 Previously these methods would make requests without a database prefix,
228 implicitly using the `_system` database.
229
230- `aql` template strings now take a generic type argument
231
232 This allows explictly setting the item type of the `ArrayCursor` returned by
233 `db.query` when using `aql` template strings. Note that like when setting
234 the type on `db.query` directly, arangojs can make no guarantees that the
235 type matches the actual data returned by the query.
236
237 ```ts
238 const numbers = await db.query(aql<{ index: number; squared: number }>`
239 FOR i IN 1..1000
240 RETURN {
241 index: i,
242 squared: i * i
243 }
244 `);
245 const first = await numbers.next(); // { index: number; squared: number; }
246 console.log(first.index, first.squared); // 1 1
247 ```
248
249### Fixed
250
251- Fixed `listUsers` behavior ([#782](https://github.com/arangodb/arangojs/issues/782))
252
253- Fixed `graph.create` not correctly handling `isDisjoint` option
254
255### Added
256
257- Added missing attributes to `QueryInfo` and `MultiExplainResult.stats` types (DE-607)
258
259- Added cluster rebalancing methods to `Database` (DE-583)
260
261- Added `db.withTransaction` helper method for streaming transactions ([#786](https://github.com/arangodb/arangojs/discussions/786))
262
263 This method allows using streaming transactions without having to manually
264 begin and commit or abort the transaction.
265
266 ```ts
267 const vertices = db.collection("vertices");
268 const edges = db.collection("edges");
269 const info = await db.withTransaction([vertices, edges], async (step) => {
270 const start = await step(() => vertices.document("a"));
271 const end = await step(() => vertices.document("b"));
272 return await step(() => edges.save({ _from: start._id, _to: end._id }));
273 });
274 ```
275
276## [8.3.1] - 2023-06-05
277
278### Changed
279
280- Added note that Simple Queries traversals are removed in ArangoDB 3.12.
281
282## [8.3.0] - 2023-05-11
283
284### Fixed
285
286- Fixed `updateUser` and `replaceUser` behavior ([#783](https://github.com/arangodb/arangojs/issues/783))
287
288### Added
289
290- Added `renewAuthToken` method to `Database` ([#784](https://github.com/arangodb/arangojs/issues/784))
291
292 This method allows refreshing the authentication token passed to the
293 `useBearerAuth` method or used by the `login` method. Note that ArangoDB
294 will currently only return a new token if the token is going to expire
295 in the next 150 seconds.
296
297- Added `returnOld` and `mergeObjects` to `CollectionInsertOptions` type
298
299 These options are only available when using `overwriteMode`.
300
301- Added caching options to `InvertedIndex` and `ArangoSearchView` types
302
303 These options were added in ArangoDB 3.10.2.
304
305- Added support for `ArangoSearchView` type `storedValues` shorthand notation
306
307 Instead of using an object, attributes can also be defined as arrays of
308 strings and arrays of arrays of strings. This was added in ArangoDB 3.10.3.
309
310- Added `peakMemoryUsage` and `executionTime` to `SingleExplainResult.stats` type
311
312 These attributes were added in ArangoDB 3.10.4.
313
314- Added `geo_s2` Analyzer types
315
316 This Analyzer was added in ArangoDB 3.10.5.
317
318- Added `refillIndexCaches` option to document operation options types
319
320 This option was added in ArangoDB 3.11.
321
322- Added `optimizeTopK` to `ArangoSearchView` and `InvertedIndex` types
323
324 This option was added in ArangoDB 3.11.
325
326- Added support for `allowRetry` option in `db.query`
327
328 This feature was added in ArangoDB 3.11.
329
330- Added `x-arango-driver` header
331
332 The arangojs driver now correctly identifies itself to ArangoDB, allowing the
333 ArangoGraph Insights Platform to take advantage of the driver's support for
334 cloud-optimized behaviors.
335
336## [8.2.1] - 2023-04-05
337
338### Fixed
339
340- Fixed a bug in search parameter handling in the browser version
341
342 Previously the browser version would incorrectly handle search parameters,
343 which could result in invalid request URLs in many cases.
344
345## [8.2.0] - 2023-03-29
346
347### Changed
348
349- Index names are now automatically NFC-normalized (DE-506)
350
351 This change affects all index names using unicode characters. **The change
352 has no effect when using non-unicode (ASCII) names.**
353
354 Any names used when creating/ensuring indexes or passed to any methods that
355 expect an `IndexSelector` will automatically be NFC normalized.
356
357- Internal querystring handling logic now uses `URLSearchParams` instead of
358 node `querystring` module
359
360 This change should be backwards compatible but may produce different results
361 when relying on undefined behavior in custom (e.g. Foxx) routes.
362
363## [8.1.0] - 2022-12-19
364
365### Added
366
367- Added support for new ArangoDB 3.9.5 `cache` field in ArangoSearch types
368
369## [8.0.0] - 2022-10-25
370
371This is a major release and breaks backwards compatibility.
372
373See [the migration guide](./MIGRATING.md#v7-to-v8) for detailed instructions
374for upgrading your code to arangojs v8.
375
376### Removed
377
378- Removed Node.js 10 and Node.js 12 support
379
380 With Node.js 10 and 12 having reached their end of life, arangojs will no
381 longer support these versions of Node.js going forward.
382
383- Removed Internet Explorer and older browser support
384
385 As of version 8 arangojs uses the [Browserlist `defaults`](https://browsersl.ist/#q=defaults)
386 list to generate the pre-built browser bundle, which excludes older browsers
387 and specifically all versions of Internet Explorer.
388
389 You may still be able to use arangojs in some of the excluded browsers when
390 bundling arangojs yourself but this may require polyfills and additional
391 transformations.
392
393- Removed `Dict` type from `connection` module
394
395 The `Dict<T>` type was identical to `Record<string, T>` and has been replaced
396 with this built-in type across arangojs.
397
398- Removed workaround for ArangoDB pre-3.2.8 Foxx HTTP API responses
399
400 When fetching or modifying the configuration or dependencies of a Foxx
401 service using ArangoDB 3.2.7 and earlier, arangojs would perform additional
402 operations to convert the server response to a compatible format. All
403 affected versions of ArangoDB have reached End of Life since December 2018.
404
405- Removed deprecated `db.useDatabase` method
406
407 The method was previously deprecated and can be replaced with `db.database`,
408 which returns a new `Database` object instead of modifying the existing one.
409
410- Removed deprecated MMFiles methods and types
411
412 The MMFiles storage engine was removed in ArangoDB 3.7.
413
414- Removed deprecated `minReplicationFactor` option from collection and
415 database related types
416
417 This option was renamed to `writeConcern` in ArangoDB 3.6.
418
419- Removed deprecated `overwrite` option from `CollectionInsertOptions` type
420
421 This option was deprecated in ArangoDB 3.7 and should be replaced with the
422 `overwriteMode` option.
423
424- Removed internal `request.host` attribute
425
426 This attribute has been replaced with `request.hostUrl`.
427
428- Removed internal `response.arangojsHostId` attribute
429
430 This attribute has been replaced with `response.arangojsHostUrl`.
431
432- Removed `CollectionStatus` and `CollectionType` enum re-exports
433
434 Previously these would be re-exported by the arangojs module for backwards
435 compatibility. If you still need to access these enums, you can import them
436 from the `collection` sub-module instead. Note that the `ViewType` enum
437 has been removed completely.
438
439### Changed
440
441- Changed default URL to `http://127.0.0.1:8529` to match ArangoDB default
442
443 Previously arangojs would use `localhost` which on some systems resolves to
444 the IPv6 address `::1` instead, resulting in confusing connection errors.
445
446- Changed TypeScript compilation target to ES2020
447
448 Since all evergreen browsers including Firefox ESR and all active Node.js LTS
449 releases fully support ES2020, the compilation target for the browser bundle
450 and Node.js has been moved from ES2016 and ES2018 respectively to ES2020.
451
452- Updated TypeScript to version 4.8
453
454 This may result in type signatures that are incompatible with TypeScript 3
455 being added in future releases (including patch releases).
456
457- Changed default behavior of _internal_ `db.request` method
458
459 Previously this method would always return the full response object if no
460 `transform` callback was provided. The method now defaults to a `transform`
461 callback that extracts the response body instead. The previous behavior can
462 still be forced by passing `false` instead of a callback function.
463
464 This change has no effect on other methods like `route.request`.
465
466- Replaced node core module polyfills with native APIs in browser build
467
468 As part of upgrading to webpack 5, arangojs now no longer requires node core
469 modules to be polyfilled to work in the browser. This also drastically
470 reduces the file size of the pre-built browser bundle `arangojs/web`.
471
472- `db.query` now supports a generic return type ([#764](https://github.com/arangodb/arangojs/issues/764))
473
474 This allows explictly setting the item type of the `ArrayCursor` returned by
475 the query without using a type assertion on the promise result. Note that
476 arangojs can make no guarantees that the type matches the actual data
477 returned by the query.
478
479 ```ts
480 const numbers = await db.query<{ index: number; squared: number }>(aql`
481 FOR i IN 1..1000
482 RETURN {
483 index: i,
484 squared: i * i
485 }
486 `);
487 const first = await numbers.next(); // { index: number; squared: number; }
488 console.log(first.index, first.squared); // 1 1
489 ```
490
491- Moved `aql.literal` and `aql.join` into `aql` module
492
493 Previously these were available as methods on the `aql` function. Now they
494 need to be imported from the `aql` module.
495
496- Changed return values of `db.getUserAccessLevel` and `db.getUserDatabases`
497 to match documented return types
498
499- Retry requests resulting in status 503 `ArangoError` ([#710](https://github.com/arangodb/arangojs/issues/710))
500
501 Unless retries are explicitly disabled by setting `config.maxRetries` to
502 `false`, requests will now also be retried if the server responded with a
503 503 `ArangoError`, which ArangoDB uses to indicate the server is running in
504 maintenance mode. Previously this would always result in an error.
505
506- Extended `CursorExtras` type in TypeScript
507
508 The types of the attributes `plan`, `profile`, and `stats` are now defined
509 more explicitly.
510
511- Changed behavior of `collection.removeAll` for non-string arrays
512
513 Previously `collection.removeAll` would always convert its argument into an
514 array of document IDs and fail with an error if passed any documents had an
515 ID not matching the collection name. Now the selector argument is passed
516 as-is, bypassing this validation but allowing `ignoreRevs` to be respected
517 by the server.
518
519- Extracted type `ArangoSearchViewLinkOptions` from `ArangoSearchViewLink`
520
521 Note that `ArangoSearchViewLink` now represents the type of the value
522 returned by the server, marking several properties as required.
523
524- Extracted type `CreateArangoSearchView` from
525 `ArangoSearchViewPropertiesOptions`
526
527 Note that `ArangoSearchViewPropertiesOptions` now includes only those options
528 that can be updated/replaced whereas `CreateArangoSearchView` also includes
529 options that can only be set during creation of a view.
530
531- Renamed type `GraphCreateOptions` to `CreateGraphOptions`
532
533- Renamed type `PrimarySortCompression` to `Compression`
534
535- Replaced type `AnalyzerInfo` and all its constituent types
536
537 Previously each type of Analyzer was represented by an `AnalyzerInfo` type
538 and (where relevant) an `AnalyzerProperties` type, which were used for both
539 creating and fetching Analyzers. The new types more closely follow the
540 pattern already used for index types, providing pairs of
541 `CreateAnalyzerOptions` and `AnalyzerDescription` types.
542
543- Removed enum `ViewType`, type `ArangoSearchView` and changed `View` class to
544 be non-generic
545
546 The `View` class now behaves analogous to the `Analyzer` class. The various
547 types related to different view types have been restructured to more closely
548 follow the pattern used for indexes and analyzers.
549
550### Deprecated
551
552- Deprecated `EnsureFulltextIndexOptions` and `FulltextIndex` types
553
554 Fulltext indexes have been deprecated in ArangoDB 3.10 and should be replaced
555 with ArangoSearch.
556
557- Deprecated `BytesAccumConsolidationPolicy` type
558
559 The `bytes_accum` consolidation policy for views was deprecated in
560 ArangoDB 3.7 and should be replaced with the `tier` consolidation policy.
561 The type is also no longer supported in `ArangoSearchViewPropertiesOptions`.
562
563### Added
564
565- Added `toJSON` method to system errors
566
567 ArangoJS already adds the `request` object to system errors encountered
568 while attempting to make network requests. This change makes it easier
569 to serialize these error objects to JSON the same way `ArangoError` and
570 `HttpError` objects can already be serialized.
571
572- Added `allowDirtyRead` option to `db.beginTransaction`, `trx.commit`,
573 `trx.abort`, `collection.edges`, `collection.inEdges`, `collection.outEdges`
574
575 The option is only respected by read-only requests.
576
577- Added support for `ifMatch` and `ifNoneMatch` options ([#707](https://github.com/arangodb/arangojs/issues/707))
578
579- Added `overwrite` option to `db.acquireHostList` ([#711](https://github.com/arangodb/arangojs/issues/711))
580
581 Setting this option to `true` will replace the current host list, removing any
582 hosts no longer present in the cluster.
583
584- Added new ArangoDB 3.10 `legacyPolygons` option to `EnsureGeoIndexOptions`
585 and `GeoIndex` types
586
587 Geo indexes created in ArangoDB pre-3.10 will implicitly default this option
588 to `true`. ArangoDB 3.10 and later will default to `false` and use the new
589 parsing rules for geo indexes.
590
591- Added support for new ArangoDB 3.10 `cacheEnabled` and `storedValues` options
592 in persistent indexes
593
594- Added support for new ArangoDB 3.10 computed values in collections
595
596- Added support for new ArangoDB 3.10 `InvertedIndex` type
597
598- Added support for new ArangoDB 3.10 `offset` Analyzer feature
599
600- Added support for new ArangoDB 3.10 `minhash`, `classification` and
601 `nearest_neighbors` Analyzer types
602
603- Added missing `replicationFactor` and `writeConcern` options to
604 `CollectionPropertiesOptions` type
605
606- Added missing `commitIntervalMsec` option to `ArangoSearchViewProperties`
607 type
608
609- Added missing `deduplicate` option to `EnsurePersistentIndexOptions` type
610 ([#771](https://github.com/arangodb/arangojs/issues/771))
611
612- Added missing `unique` option to `EnsureZkdIndexOptions` type
613
614- Added missing `deduplicate` and `estimates` fields to `PersistentIndex` type
615
616- Added new ArangoDB 3.10 `db.queryRules` method
617
618- Added support for `Analyzer` in `aql` templates
619
620 `Analyzer` objects can now be passed into `aql` templates like `View` and
621 `ArangoCollection` objects.
622
623- Added `retryOnConflict` option to `Config`
624
625 If set to any number, this value will be used as the default value for all
626 requests unless explicitly overridden when using `db.query` or
627 `route.request`.
628
629## [7.8.0] - 2022-05-19
630
631### Added
632
633- Added `retryOnConflict` option to `db.query` and `route.request`
634
635 This option allows specifying the number of times the request will be retried
636 if it results in a write-write conflict.
637
638## [7.7.0] - 2022-01-26
639
640### Changed
641
642- Unicode names are now automatically NFC normalized
643
644 This change affects all database, collection, graph, view and analyzer names
645 using unicode characters. **The change has no effect when using non-unicode
646 (ASCII) names.** At this time, ArangoDB does not support unicode characters
647 in any of these names but experimental support for unicode database names is
648 available in ArangoDB 3.9 using the `--database.extended-names-databases`
649 startup option.
650
651 Any names used to create `Database`, `Collection`, etc instances or passed to
652 methods will automatically be NFC normalized. Additionally the collection
653 name part of any value passed as a `DocumentSelector` and the collection name
654 part of values returned by `collection.documentId` will automatically be NFC
655 normalized.
656
657### Deprecated
658
659- Deprecated `EnsureHashIndexOptions` and `EnsureSkiplistIndexOptions` types
660
661 The hash and skiplist index types have been deprecated in ArangoDB 3.9 and
662 should be replaced with persistent indexes which behave identically.
663
664- Deprecated all MMFiles related options and methods
665
666 The MMFiles storage engine was removed in ArangoDB 3.7.
667
668### Added
669
670- Added support for new ArangoDB 3.9 `CollationAnalyzer` and
671 `SegmentationAnalyzer` types
672
673- Added support for new ArangoDB 3.9 (multi-dimensional) `ZkdIndex` type
674
675- Added support for new ArangoDB 3.9 Hybrid SmartGraphs graph options
676
677- Added support for new ArangoDB 3.9 response queue time reporting
678
679 This adds the `db.queueTime` property, which provides methods for accessing
680 queue time metrics reported by the most recently received server responses if
681 the server supports this feature.
682
683- Added `ArangoSearchViewLink#inBackground` ([#759](https://github.com/arangodb/arangojs/issues/759))
684
685- Added `collection.compact` ([#630](https://github.com/arangodb/arangojs/issues/630))
686
687## [7.6.1] - 2021-10-26
688
689### Fixed
690
691- Changed all uses of `Record<string, unknown>` to `Record<string, any>` ([#750](https://github.com/arangodb/arangojs/issues/750))
692
693 This should allow using more specific types without having to implement
694 index signatures.
695
696## [7.6.0] - 2021-10-20
697
698### Added
699
700- Added `collection.documents` for fetching multiple documents
701
702- Added support for `fillBlockCache` query option
703
704- Added support for passing `Graph` objects in AQL queries ([#740](https://github.com/arangodb/arangojs/issues/740))
705
706 This also adds the `isArangoGraph` helper function for type checking.
707
708- Added User Management API ([#664](https://github.com/arangodb/arangojs/issues/664))
709
710 This implements the endpoints of the
711 [HTTP Interface for User Management](https://www.arangodb.com/docs/stable/http/user-management.html)
712
713### Fixed
714
715- Added missing `hex` option to `StopwordsAnalyzer` type ([#732](https://github.com/arangodb/arangojs/issues/732))
716
717- Added missing `details` option to `collection.figures` ([#728](https://github.com/arangodb/arangojs/issues/728))
718
719- Added missing `inBackground` option to index options ([#734](https://github.com/arangodb/arangojs/issues/734))
720
721## [7.5.0] - 2021-04-22
722
723### Added
724
725- Added support for new ArangoDB 3.8 Analyzer types
726
727 This adds the `PipelineAnalyzer`, `AqlAnalyzer`, `GeoJsonAnalyzer`,
728 `GeoPointAnalyzer` and `StopwordsAnalyzer` types in TypeScript, as well as
729 the Analyzer-specific properties types.
730
731- Added support for new ArangoDB 3.8 `estimates` option for indexes
732
733 This affects the `PersistentIndex`, `HashIndex` and `SkiplistIndex` types
734 in TypeScript.
735
736## [7.4.0] - 2021-04-09
737
738### Added
739
740- Implemented `toJSON` methods for `ArangoError` and `HttpError` ([#632](https://github.com/arangodb/arangojs/issues/632))
741
742 This prevents an error where `JSON.stringify` would reliably throw if passed
743 an instance of either of these error types generated by arangojs. Note that
744 you may still want to implement your own JSON representation logic as system
745 errors (e.g. `ECONNREFUSED`) are not wrapped by arangojs and thrown as-is.
746
747### Fixed
748
749- Stack traces are now improved for most errors when using `precaptureStackTraces` ([#722](https://github.com/arangodb/arangojs/issues/722))
750
751 Previously this option would only affect network errors, making it far less
752 useful than intended. Now parsing errors, `ArangoError` instances and HTTP
753 errors also receive improved error stack traces when this option is enabled.
754
755- Improved performance for `precaptureStackTraces` when no errors occur
756
757 The generated stack is now only accessed on demand, allowing the runtime to
758 delay generation of the stack trace string. Previously the stack would always
759 be accessed prior to the request being sent, causing a noticeable delay even
760 when no error occurs.
761
762- Fixed document selector validation in `collection.edges` and its variants ([#704](https://github.com/arangodb/arangojs/issues/704))
763
764 These methods previously only permitted start vertices that are documents
765 within the edge collection itself. This behavior has now been corrected to
766 permit start vertices outside the collection, as expected.
767
768## [7.3.0] - 2021-03-08
769
770### Changed
771
772- Changed the default for `agentOptions.scheduling` to `"lifo"`
773
774 This is already the default in Node v15.6 but can reduce latency caused by
775 sockets expiring, especially with larger connection pools and infrequent
776 requests.
777
778- Removed `keepAlive`-specific throughput optimization
779
780 Previously arangojs would allow `agentOptions.maxSockets * 2` concurrent
781 requests, to optimize socket reuse by avoiding idle time. This behavior
782 could trigger deadlocks when attempting to perform multiple transactions
783 in parallel and only marginally improved throughput in some high-load
784 scenarios. The connection pool size now always reflects the value set in
785 `agentOptions.maxSockets` regardless of whether `keepAlive` is enabled.
786
787- Changed `agentOptions.maxSockets` default value when using `ROUND_ROBIN`
788
789 As the connection pool is shared across all server connections when using
790 `ROUND_ROBIN` load balancing, the default value of `3` is too limiting for
791 most scenarios involving multiple coordinators. When passing multiple URLs
792 via the `url` option and specifying `ROUND_ROBIN` load balancing, arangojs
793 will now default this value to `url.length * 3` instead.
794
795## [7.2.0] - 2020-12-02
796
797### Added
798
799- Added `db.waitForPropagation` method
800
801 This method helps with setting up databases in a cluster scenario by waiting
802 for a request to succeed on every known coordinator.
803
804## [7.1.1] - 2020-11-30
805
806This is a maintenance release and contains no bugfixes or features.
807
808## [7.1.0] - 2020-10-16
809
810### Changed
811
812- Killing a cursor now also drains it locally
813
814### Fixed
815
816- Fixed a potential memory leak in cursor batch handling
817
818## [7.0.2] - 2020-09-25
819
820### Fixed
821
822- Fixed incorrect HTTP method call in `patch` method ([#687](https://github.com/arangodb/arangojs/pull/687))
823
824- Fixed empty query results containing `[undefined]` ([#683](https://github.com/arangodb/arangojs/issues/683))
825
826- Fixed `updateByExample` and `replaceByExample` new value parameter name
827
828 Note that these methods are still deprecated. Previously the `newValue`
829 parameter was incorrectly called `newData`, which prevented the methods from
830 working at all.
831
832## [7.0.1] - 2020-08-21
833
834This is a maintenance release because the initial v7 release did not include
835a README file.
836
837## [7.0.0] - 2020-08-21
838
839This is a major release and breaks backwards compatibility.
840
841See [the migration guide](./MIGRATING.md#v6-to-v7) for detailed instructions
842for upgrading your code to arangojs v7.
843
844For a detailed list of changes between pre-release versions of v7 see the
845[Changelog of the final v7 release candidate](https://github.com/arangodb/arangojs/blob/v7.0.0-rc.2/CHANGELOG.md).
846
847### Removed
848
849#### General
850
851- Removed ArangoDB 2.8 support
852
853 ArangoDB 2.8 has reached End of Life since mid 2018. Version 7 and above
854 of arangojs will no longer support ArangoDB 2.8 and earlier.
855
856- Removed Node.js 6/8 support
857
858 As of version 7 arangojs now requires language support for async/await.
859 This means arangojs requires Node.js 10 (LTS) or newer to function correctly.
860
861- Removed support for absolute endpoint URLs
862
863 This removes the `isAbsolute` option from the arangojs configuration.
864
865- Removed `ArangoError` re-export
866
867 The type can still be imported directly from the `error` module.
868
869- Removed `statusCode` properties of `ArangoError` and `HttpError`
870
871 Both of these error types still expose the HTTP status code as the `code`
872 property. For `ArangoError` the true HTTP status code may be different and
873 can still be accessed using the `response.statusCode` property.
874
875#### Database API
876
877- Removed `db.edgeCollection` method
878
879 As arangojs 7 uses the same implementation for document and edge collections,
880 this method is no longer necessary. Generic collection objects can still be
881 cast to `DocumentCollection` or `EdgeCollection` types in TypeScript.
882
883- Removed `db.truncate` convenience method
884
885 This was a wrapper around `db.listCollections` and `collection.truncate`.
886 The behavior of `db.truncate` can still be emulated by calling these methods
887 directly.
888
889#### Collection API
890
891- Removed collection `createCapConstraint`, `createHashIndex`,
892 `createSkipList`, `createPersistentIndex`, `createGeoIndex` and
893 `createFulltextIndex` methods
894
895 These methods are no longer part of the official ArangoDB API and can be
896 replaced by using the `collection.ensureIndex` method.
897
898- Removed `save(fromId, toId, edgeData)` method variants
899
900 Methods for creating edges now require the `_to` and `_from` attributes to
901 be specified in the edge (document) data and no longer accept these values
902 as positional arguments.
903
904- Removed `collection.bulkUpdate` method
905
906 The new method `collection.updateAll` now provides this functionality.
907
908- Removed `collection.edge` method
909
910 This method was previously an alias for `collection.document`.
911
912 The method `graphEdgeCollection.edge` is unaffected by this change.
913
914- Removed `graphName` option for `edgeCollection.traversal`
915
916 Graph traversals can still be performed via `graph.traversal`.
917
918#### Graph API
919
920- Removed generic collection methods from `GraphVertexCollection`
921
922 All methods that are not part of the graph API have been removed.
923 The underlying collection can still be accessed from the `collection`
924 property.
925
926- Removed generic collection methods from `GraphEdgeCollection`
927
928 All methods that are not part of the graph API have been removed.
929 The underlying collection can still be accessed from the `collection`
930 property.
931
932#### Cursor API
933
934- Removed `cursor.some` and `cursor.every` methods
935
936 These methods encouraged overfetching and should be replaced with more
937 efficient AQL queries.
938
939 The behavior can still be implemented by using the `next` method directly
940 or iterating over the cursor using the `forEach` method or the `for await`
941 syntax.
942
943#### View API
944
945- Removed `ViewResponse` type
946
947 The type `ViewDescription` represents the same structure.
948
949- Removed `ArangoSearchViewPropertiesResponse` type
950
951 The type `ArangoSearchViewProperties & ViewDescription` can be used
952 to represent the same structure.
953
954### Deprecated
955
956#### Database API
957
958- Deprecated `db.useDatabase` method
959
960 Using this method will affect `Collection`, `Graph` and other objects
961 already created for the given database and change which database these
962 refer to, which may cause unexpected behavior.
963
964 As of arangojs 7 the `db.database` method can be used instead to create a
965 new, separate `Database` object using the same connection pool.
966
967#### Collection API
968
969- Deprecated `Collection` methods for simple queries: `list`, `all`, `any`,
970 `byExample`, `firstExample`, `removeByExample`, `replaceByExample`,
971 `updateByExample`, `lookupByKeys`, `removeByKeys`, `fulltext`
972
973 These methods were deprecated in ArangoDB 3.4 and should no longer be used.
974 They will still behave correctly with versions of ArangoDB supporting these
975 methods but may be removed in a future ArangoDB release.
976
977 Their behavior can be emulated using AQL queries.
978
979#### Graph API
980
981- Deprecated `graph.traversal` and `collection.traversal`
982
983 These methods were deprecated in ArangoDB 3.4 and should no longer be used.
984 They will still behave correctly with versions of ArangoDB supporting these
985 methods but may be removed in a future ArangoDB release.
986
987 Their behavior can be emulated using AQL graph traversal.
988
989### Changed
990
991#### General
992
993- Multiple `Database` objects can now share a single `Connection`
994
995 All arangojs objects now reference a `Database` object rather than accessing
996 the underlying `Connection` directly. This allows multiple `Database` objects
997 to be created by using the `db.database` method while still allowing the
998 creation of separate database objects with separate connection pools if
999 desired.
1000
1001- Memoized `Database`, `Collection`, `Graph`, `View` and `Analyzer`
1002
1003 Database objects are now memoized per-connection and the other object types
1004 are memoized per-database. Using `useDatabase` de-memoizes the database
1005 object to prevent unexpected behavior.
1006
1007- Added support for `View` in `aql` templates ([#667](https://github.com/arangodb/arangojs/issues/667))
1008
1009 `View` (or `ArangoSearchView`) objects can now be passed into `aql` templates
1010 like `ArangoCollection` objects.
1011
1012- Moved `collectionToString` helper into `collection` module
1013
1014- Moved `Dict` type into `connection` module
1015
1016- Moved `Patch` type into `documents` module
1017
1018- Removed `Errback` type from public API
1019
1020- Renamed `util/foxx-manifest` module to `foxx-manifest`
1021
1022#### Database API
1023
1024- Renamed method `db.arangoSearchView` to `db.view`
1025
1026- Renamed method `db.createArangoSearchView` to `db.createView`
1027
1028- Replaced methods `db.enableServiceDevelopmentMode` and
1029 `db.disableServiceDevelopmentMode` with `db.setServiceDevelopmentMode`
1030
1031- Flattened database `query` method `options` argument
1032
1033 The optional `options` argument previously contained an additional `options`
1034 object with additional query options. These options are now specified on the
1035 `options` argument itself directly.
1036
1037 Before:
1038
1039 ```js
1040 db.query(aql`FOR doc IN ${collection} RETURN doc`, {
1041 cache: false,
1042 options: { fullCount: true },
1043 });
1044 ```
1045
1046 After:
1047
1048 ```js
1049 db.query(aql`FOR doc IN ${collection} RETURN doc`, {
1050 cache: false,
1051 fullCount: true,
1052 });
1053 ```
1054
1055- Changed `db.listServices` option `excludeSystem` default to `true`
1056
1057 To be more consistent with the equivalent options in other methods,
1058 the default value has been changed from `false` to `true`.
1059
1060- Changed `db.createDatabase` return type to `Database`
1061
1062- Renamed `database.setQueryTracking` to `database.queryTracking`
1063
1064 The method will now return the existing query tracking properties or set the
1065 new query tracking properties depending on whether an argument is provided.
1066
1067- Method `db.transaction` no longer acts as an alias for `executeTransaction`
1068
1069 The method now only allows looking up transactions by ID. Previously it would
1070 wrap `executeTransaction` if passed the arguments expected by that method.
1071
1072#### Collection API
1073
1074- Merged `DocumentCollection` and `EdgeCollection` APIs
1075
1076 All collections are now implemented as generic `Collection` objects.
1077 In TypeScript the generic collection object can still be explicitly cast to
1078 `DocumentCollection` or `EdgeCollection` for stricter type safety.
1079
1080- Renamed `collection.setProperties` to `collection.properties`
1081
1082 The method will now return the existing properties or set the properties
1083 depending on whether an argument is provided.
1084
1085- Removed `CollectionMetadata` fields from `CollectionProperties` type
1086
1087 Methods that previously returned `CollectionProperties` now return
1088 `CollectionMetadata & CollectionProperties`.
1089
1090- Collection methods `save`, `update`, `replace` and `remove` no longer take
1091 arrays as input
1092
1093 The array versions have been renamed to `saveAll`, `updateAll`, `replaceAll`
1094 and `removeAll` to reduce the likelihood of mistakes and provide more helpful
1095 type signatures.
1096
1097- Collection methods will now throw errors when passed documents or document
1098 IDs from different collections where a document key or ID for a document in
1099 the same collection is expected
1100
1101 For example the following code will now result in an error rather than the
1102 document from a different collection being returned:
1103
1104 ```js
1105 const aliceId = "alice/123"; // Document from collection "alice"
1106 const bobCol = db.collection("bob"); // Collection "bob"
1107 const doc = await bobCol.document(aliceId); // THROWS
1108 ```
1109
1110- Changed `collection.import` option `type` behavior
1111
1112 Previously this option would always default to `"auto"`.
1113
1114 When passing a `string`, `Buffer` or `Blob` as data, the option now defaults
1115 to `undefined`. This matches the behavior in previous versions of setting
1116 the option explicitly to `null`.
1117
1118 Additionally, the value `"array"` has been replaced with `"list"`.
1119
1120 When passing an array as data, the option is now no longer supported as the
1121 corresponding value will be inferred from the array's contents:
1122
1123 If the array's first item is also an array, it will match the behavior in
1124 previous versions of setting the option explicitly to `null`.
1125
1126 Otherwise it will match the behavior in previous versions of setting the
1127 option explicitly to `"documents"` or `"auto"`, or omitting it entirely.
1128
1129- Changed `collection.list` return type to `ArrayCursor`
1130
1131#### Graph API
1132
1133- Graph methods now also accept `ArangoCollection` instances instead of names
1134
1135 This brings these methods behavior in line with that of the `beginTransaction`
1136 and `executeTransaction` methods of `Database` objects.
1137
1138- Graph `create` method (and `db.createGraph`) signature changed
1139
1140 The `graph.create` method now takes an array of edge definitions as the
1141 first argument and any additional options (not just the `waitForSync`
1142 option) as the second argument.
1143
1144 Before:
1145
1146 ```js
1147 await graph.create(
1148 {
1149 edgeDefinitions: [{ collection: "edges", from: ["a"], to: ["b"] }],
1150 isSmart: true,
1151 },
1152 { waitForSync: true }
1153 );
1154 ```
1155
1156 After:
1157
1158 ```js
1159 await graph.create([{ collection: "edges", from: ["a"], to: ["b"] }], {
1160 isSmart: true,
1161 waitForSync: true,
1162 });
1163 ```
1164
1165- First argument to `graph.replaceEdgeDefinition` is now optional
1166
1167 Since the new edge definition already includes the edge collection name
1168 that identifies the edge definition, it is now possible to specify only the
1169 new edge definition object without additionally specifying the collection
1170 name as the first argument.
1171
1172 Before:
1173
1174 ```js
1175 await graph.replaceEdgeDefinition("edges", {
1176 collection: "edges", // This is a bit redundant
1177 from: ["a"],
1178 to: ["b"],
1179 });
1180 ```
1181
1182 After:
1183
1184 ```js
1185 await graph.replaceEdgeDefinition({
1186 collection: "edges",
1187 from: ["a"],
1188 to: ["b"],
1189 });
1190 ```
1191
1192- Graph collection return values now contain `old` and `new` properties when
1193 `returnOld` or `returnNew` options are used
1194
1195 This behavior represents a compromise between remaining consistent with the
1196 behavior of the regular collection method equivalents and remaining
1197 compatible with the ArangoDB HTTP API response object quirks.
1198
1199#### Cursor API
1200
1201- Replaced `ArrayCursor` methods `hasNext` and `hasMore` with getters
1202
1203- Renamed `ArrayCursor` method `each` to `forEach`
1204
1205- Renamed `cursor.nextBatch` to `cursor.batches.next`
1206
1207- Renamed `cursor.hasMore` to `cursor.batches.hasMore`
1208
1209- In TypeScript `ArrayCursor` is now a generic type
1210
1211 TypeScript users can now cast cursor instances to use a specific type for
1212 its values rather than `any` to aid type safety.
1213
1214#### View API
1215
1216- Renamed `view.setProperties` to `view.updateProperties`
1217
1218- Renamed type `ArangoView` to `View`
1219
1220#### Analyzer API
1221
1222- Renamed type `ArangoAnalyzer` to `Analyzer`
1223
1224#### Transaction API
1225
1226- Renamed type `ArangoTransaction` to `Transaction`
1227
1228- Renamed `transaction.run` to `transaction.step`
1229
1230 This should hopefully make it more obvious that sequential calls to arangojs
1231 methods should be split into separate calls of this method.
1232
1233### Added
1234
1235#### General
1236
1237- Added `databaseName` configuration option
1238
1239 Setting this option to a database name will result in the initial `Database`
1240 object using this database instead of the default `_system` database.
1241
1242- Added `auth` configuration option
1243
1244 It is now possible to pass authentication credentials using the `auth`
1245 option in addition to calling `db.useBasicAuth` or `db.useBearerAuth`.
1246
1247- Added `precaptureStackTraces` configuration option ([#599](https://github.com/arangodb/arangojs/issues/599))
1248
1249 This option can be used to get more useful stack traces but results in a
1250 performance hit on every request.
1251
1252- Added `before` and `after` to the `agentOptions` configuration option ([#585](https://github.com/arangodb/arangojs/issues/585))
1253
1254 These methods can be used to track performance metrics for outgoing requests.
1255
1256- Improved type signatures for TypeScript and inline documentation
1257
1258 Most methods should now provide full type signatures for options and response
1259 objects and provide inline documentation in IDEs and editors that support
1260 this feature in TypeScript and JavaScript.
1261
1262#### Database API
1263
1264- Added `db.database` method
1265
1266 This method replaces the use case for the deprecated `db.useDatabase`
1267 method.
1268
1269- Added support for extended options in `db.createDatabase`
1270
1271 This method now supports passing an extended options object instead of
1272 passing the users array directly.
1273
1274- Added `db.createCollection` and `db.createEdgeCollection` methods
1275
1276 These are convenience methods wrapping `collection.create`. In TypeScript
1277 `createEdgeCollection` will return a collection cast to the `EdgeCollection`
1278 type.
1279
1280- Added `db.createGraph` method
1281
1282 This is a convenience method wrapping `graph.create`.
1283
1284- Added `db.createArangoSearchView` method
1285
1286 This is a convenience method wrapping `view.create`.
1287
1288- Added `db.createAnalyzer` method
1289
1290 This is a convenience method wrapping `analyzer.create`.
1291
1292- Added support for `db.createFunction` option `isDeterministic`
1293
1294- Added support for `db.listServices` option `excludeSystem`
1295
1296#### Collection API
1297
1298- Added collection `saveAll`, `updateAll`, `replaceAll` and `removeAll` methods
1299
1300 These methods replace the respective array versions of the collection
1301 methods `save`, `update`, `replace` and `remove`, which no longer accept
1302 arrays as inputs.
1303
1304- Added `collection.documentId` method
1305
1306 The method takes a document or a document key and returns a fully qualified
1307 document ID string for the document in the current collection.
1308
1309- Added support for values `"ignore"` and `"conflict"` in `overwriteMode`
1310 option when saving documents using the Collection API
1311
1312#### Graph API
1313
1314- Added `graphVertexCollection.vertexExists` and
1315 `graphEdgeCollection.edgeExists` methods
1316
1317 These mimic the behavior of the `collection.documentExists` method but using
1318 the Graph API.
1319
1320- Added `graphVertexCollection.collection` and `graphEdgeCollection.collection`
1321
1322 These properties now provide access to regular (non-graph) collection
1323 objects for these graph collections. These objects can be used to perform
1324 operations not available within the context of a graph (e.g. bulk imports
1325 or modifying the collection itself).
1326
1327- Added support for `isDisjoint` option in Graph API
1328
1329#### Cursor API
1330
1331- Added `cursor.flatMap` method
1332
1333 This method behaves similarly to the `Array` method `flatMap` but operates
1334 on the cursor directly like `cursor.map` does.
1335
1336- Added `cursor.batches` to provide a batch-wise cursor API
1337
1338- Added support for `for await` in `ArrayCursor` ([#616](https://github.com/arangodb/arangojs/pull/616))
1339
1340 It is now possible to use `for await` to iterate over each item in a cursor
1341 asynchronously.
1342
1343#### View API
1344
1345- Added support for `primarySortCompression` and `storedValues` options in
1346 View API
1347
1348### Fixed
1349
1350#### General
1351
1352- Removed TypeScript dependency on `dom` library
1353
1354 If you are using arangojs in Node.js, you no longer need to add the `dom`
1355 library to your `tsconfig.json` configuration.
1356
1357#### Database API
1358
1359- Fixed `db.dropFunction` option `group` being ignored
1360
1361- Fixed documentation of `db.runServiceTests`
1362
1363 Previously the documentation incorrectly indicated that the default value
1364 of the `idiomatic` option is `true`. The correct default value is `false`.
1365
1366## [6.14.1] - 2020-05-01
1367
1368### Fixed
1369
1370- Added `uuid` and `padded` to legal `KeyGeneratorType` values in TypeScript ([#656](https://github.com/arangodb/arangojs/issues/656))
1371
1372- Added `overwrite` to `InsertOptions` type in TypeScript ([#657](https://github.com/arangodb/arangojs/issues/657))
1373
1374## [6.14.0] - 2020-03-18
1375
1376### Added
1377
1378- Added `db.listTransactions` and `db.transactions` methods
1379
1380## [6.13.0] - 2020-01-24
1381
1382### Changed
1383
1384- Empty querystring parameters are now omitted
1385
1386 In some cases ArangoDB would be unable to correctly handle querystring
1387 parameters without values. Any paremeters set to `undefined` will now
1388 no longer be added to the querystring.
1389
1390 This does not affect parameters set to empty string values.
1391
1392### Added
1393
1394- Added `maxRuntime` option to `db.query` method
1395
1396### Fixed
1397
1398- Replaced `linkedlist` dependency with `x3-linkedlist` ([#601](https://github.com/arangodb/arangojs/issues/601))
1399
1400 The `linkedlist` dependency had a memory leak and was no longer maintained.
1401 The replacement should fix this issue.
1402
1403## [6.12.0] - 2019-10-16
1404
1405### Added
1406
1407- Added `cursor.kill` method
1408
1409 Cursors that have not yet been fully depleted can now be killed using the
1410 `cursor.kill` method. Note that this method has no effect if the cursor
1411 is already depleted.
1412
1413- Added `cursor.nextBatch` method
1414
1415 Cursors normally fetch additional batches as necessary while iterating
1416 over the individual results, this method allows consuming an entire batch
1417 at a time.
1418
1419## [6.11.1] - 2019-08-30
1420
1421### Fixed
1422
1423- Fixed View properties not being passed correctly when creating Views ([#621](https://github.com/arangodb/arangojs/issues/621))
1424
1425- Renamed internal `response.host` attribute to `response.arangojsHostId` ([#604](https://github.com/arangodb/arangojs/pull/604))
1426
1427 In some environments the `host` attribute is already present and read-only.
1428 This should avoid a `TypeError` being thrown when a value is assigned by
1429 arangojs.
1430
1431## [6.11.0] - 2019-08-16
1432
1433### Changed
1434
1435- Renamed `db.transaction` to `db.executeTransaction`
1436
1437 The method for executing server-side transactions is now called
1438 `executeTransaction` and the `params` argument now must be passed via the
1439 `options` object.
1440
1441 For backwards-compatibility the new `db.transaction` method will continue to
1442 behave like before when passed an `action` string as the second argument.
1443 Note that this behavior is deprecated and will be removed in arangojs 7.
1444
1445### Added
1446
1447- Added support for ArangoDB 3.5 streaming transactions
1448
1449 New streaming transactions can be created using `db.beginTransaction` and
1450 existing streaming transactions can be accessed by passing the transaction ID
1451 to `db.transaction`.
1452
1453 See the documentation of the `transaction.run` method for examples of using
1454 streaming transactions with arangojs.
1455
1456- Added support for ArangoDB 3.5 Analyzers API
1457
1458 See the documentation of the `database.analyzer` method and the `Analyzer`
1459 instances for information on using this API.
1460
1461- Added `collection.getResponsibleShard` method
1462
1463- Added support for new ArangoDB 3.5 collection properties
1464
1465- Added support for new ArangoDB 3.5 View properties
1466
1467### Fixed
1468
1469- Fixed a problem causing empty nested AQL expressions to be converted to bind variables
1470
1471 Nesting an empty AQL expression like the result of calling `aql.join` with an empty
1472 array would previously result in the AQL expression not being recognized and being
1473 converted to an object bind variable instead.
1474
1475## [6.10.0] - 2018-12-22
1476
1477### Changed
1478
1479- Changed Views API to match 3.4 GA implementation
1480
1481 This release updates the Views API to the version implemented in the final
1482 ArangoDB 3.4 GA release. Please note that these changes may break code
1483 written for earlier ArangoDB 3.4 release candidates.
1484
1485### Added
1486
1487- Added `timeout` option to `db.query` and request methods ([#572](https://github.com/arangodb/arangojs/issues/572))
1488
1489 Note that this merely cancels the request. Queries will still be executed
1490 and ArangoDB will still continue processing the request, this will merely
1491 result in the socket being forcefully disconnected.
1492
1493- Added query management API ([#474](https://github.com/arangodb/arangojs/issues/474))
1494
1495 This implements most endpoints of the
1496 [HTTP Interface for AQL Queries](https://www.arangodb.com/docs/stable/http/aql-query.html).
1497
1498## [6.9.0] - 2018-11-07
1499
1500### Changed
1501
1502- Restored support for credentials in URLs
1503
1504 If the server URL includes credentials, arangojs will now use them instead of
1505 the default username "root" and an empty password. Any credentials explicitly
1506 set using `useBasicAuth` or `useBearerAuth` will still override the default
1507 credentials as before.
1508
1509## [6.8.0] - 2018-11-07
1510
1511### Changed
1512
1513- Added `any[]` to allowed types for AQL bind parameters
1514
1515 This should help in some cases where the previous TypeScript annotation
1516 was too restrictive.
1517
1518### Added
1519
1520- Added support for UNIX socket URLs ([#405](https://github.com/arangodb/arangojs/issues/405))
1521
1522 In addition to the `unix:///socket/path` and `http+unix:///socket/path`
1523 URL formats recognized by ArangoDB, arangojs also supports the format
1524 `http://unix:/socket/path` commonly supported in the Node ecosystem and
1525 automatically converts ArangoDB endpoint URLs between them.
1526
1527## [6.7.0] - 2018-10-24
1528
1529### Changed
1530
1531- No longer emitting `undefined` values in `aql` template strings
1532
1533 Previously using `undefined` values in an aql template string would result
1534 in a bind parameter being added with no value, which would always lead to an
1535 error response when ArangoDB executes the query.
1536 Now undefined values will simply be omitted, also easing the conditional
1537 insertion of query fragments.
1538
1539- Changed experimental Views API
1540
1541 This release updates the experimental support for the Views API to the version
1542 implemented in the ArangoDB 3.4 release candidate. Please note that this API
1543 is still subject to change and may indeed still change until the 3.4.0 GA release.
1544
1545- Updated TypeScript to version 3
1546
1547 This may result in type signatures that are incompatible with TypeScript 2
1548 being added in future releases (including patch releases).
1549
1550### Added
1551
1552- Added nesting support for `aql` template strings ([#481](https://github.com/arangodb/arangojs/issues/481))
1553
1554 It is now possible to use aql queries as values in `aql` template strings:
1555
1556 ```js
1557 function createQuery(flowers, color) {
1558 const filter = color ? aql`FILTER flower.color == ${color}` : undefined;
1559 return aql`FOR flower IN ${flowers} ${filter} RETURN flower`;
1560 }
1561 createQuery(db.collection("flowers", "green"));
1562 // FOR flower IN @@value0 FILTER @value1 RETURN flower
1563 // {"@value0": "flowers", "value1": "green"}
1564 createQuery(db.collection("flowers"));
1565 // FOR flower IN @@value0 RETURN flower
1566 // {"@value0": "flowers"}
1567 ```
1568
1569 Previously aql fragments could only be created with `aql.literal`, which
1570 does not support bind parameters:
1571
1572 ```js
1573 aql.literal("FILTER flower.color == " + JSON.stringify(color));
1574 // Note that we had to rely on JSON.stringify to correctly escape the value
1575 // because the value is part of the literal, not a bind parameter
1576 ```
1577
1578- Added support for `undefined` and AQL literals to `aql.literal`
1579
1580 Passing undefined to `aql.literal` will now result in an empty literal as
1581 would be expected. Passing an AQL literal back into `aql.literal` will return
1582 the existing literal rather than the string `[object Object]`.
1583
1584- Added `aql.join` function
1585
1586 The function `aql.join` can be used to convert an array of `aql` queries into
1587 a combined query:
1588
1589 ```js
1590 const users = db.collection("users");
1591 const keys = ["a", "b", "c"];
1592 const fragments = keys.map((key) => aql`DOCUMENT(${users}, ${key})`);
1593 const combined = aql`[${aql.join(fragments, ", ")}]`;
1594 // [DOCUMENT(@@value0, @value1), DOCUMENT(@@value0, @value2), \
1595 // DOCUMENT(@@value0, @value3)]
1596 // {"@value0": "users", "value1": "a", "value2": "b", "value3": "c"}
1597 const query = aql`FOR user IN ${combined} RETURN user.email`;
1598 // FOR user IN [DOCUMENT(@@value0, @value1), DOCUMENT(@@value0, @value2), \
1599 // DOCUMENT(@@value0, @value3)] RETURN user.email
1600 // {"@value0": "users", "value1": "a", "value2": "b", "value3": "c"}
1601 ```
1602
1603- Added `allowDirtyRead` option to `db.query` and `collection.document`
1604
1605 Dirty reads are supported in leader/follower replication setups and require
1606 ArangoDB 3.4 or later. When performing a request that permits dirty reads,
1607 arangojs will load balance across all know leaders and followers and instruct
1608 ArangoDB to allow responding with stale or dirty response data. Note that
1609 data returned from a dirty read may be out of date or inconsistent.
1610
1611## [6.6.0] - 2018-08-28
1612
1613### Changed
1614
1615- Re-implemented `collection.import`
1616
1617 The previous implementation was broken. The new implementation should be backwards-compatible
1618 in cases where it previously wasn't broken but is more flexible and also handles buffers.
1619
1620### Fixed
1621
1622- Added missing dependency on `@types/node` ([#567](https://github.com/arangodb/arangojs/issues/567))
1623
1624 This should solve TypeScript errors when the dependency was not already added.
1625
1626## [6.5.1] - 2018-08-15
1627
1628### Fixed
1629
1630- Fixed `edgeCollection.save` not respecting options ([#554](https://github.com/arangodb/arangojs/issues/554))
1631
1632- Fixed `database.createDatabase` TypeScript signature ([#561](https://github.com/arangodb/arangojs/issues/561))
1633
1634## [6.5.0] - 2018-08-03
1635
1636### Changed
1637
1638- Requests that fail because a server can not be reached are now automatically
1639 retried if other servers are available
1640
1641 This behavior can be controlled using the `maxRetries` option.
1642
1643- Renamed `EdgeCollection#edge` to `EdgeCollection#document`
1644
1645 `EdgeCollection#edge` is now an alias for the `document` method.
1646
1647- Renamed `GraphEdgeCollection#edge` to `GraphEdgeCollection#document`
1648
1649 `GraphEdgeCollection#edge` is now an alias for the `document` method.
1650
1651- Renamed `GraphVertexCollection#vertex` to `GraphVertexCollection#document`
1652
1653 `GraphVertexCollection#vertex` is now an alias for the `document` method.
1654
1655### Added
1656
1657- Added `maxRetries` option to configuration to control retry behavior
1658
1659- Added `collection.documentExists` method
1660
1661- Added `graceful` option to `collection.document`
1662
1663## [6.4.0] - 2018-07-06
1664
1665### Changed
1666
1667- Added TypeScript validation for `opts` in `DocumentCollection#save`
1668
1669### Added
1670
1671- Added `ArangoError` and `CollectionType` to public exports
1672
1673- Added `database.close` method
1674
1675- Added `opts` parameter to `EdgeCollection#save`
1676
1677## [6.3.0] - 2018-06-20
1678
1679### Added
1680
1681- Added `database.version` method
1682
1683- Added `database.login` method
1684
1685- Added `database.exists` method
1686
1687- Added `collection.exists` method
1688
1689- Added `graph.exists` method
1690
1691- Added `aql.literal` function
1692
1693- Exposed typings for collections and graphs ([@samrg472](https://github.com/samrg472) in [#538](https://github.com/arangodb/arangojs/pull/538))
1694
1695### Fixed
1696
1697- Fixed synchronous errors during request creation not being handled
1698
1699 Internal errors thrown while a request is created (e.g. malformed URIs) would
1700 result in unhandled errors, which could result in termination of the process
1701 or promises never being rejected. These errors are now handled normally and
1702 will result in async rejections as expected.
1703
1704## [6.2.4] - 2018-04-27
1705
1706### Fixed
1707
1708- Ensure `res.body` is an empty string instead of null in the browser version
1709
1710## [6.2.3] - 2018-04-03
1711
1712### Fixed
1713
1714- Fixed `collection.update(documentHandle, newValue, opts)` missing return value
1715
1716- Fixed `collection.removeByKeys(keys, options)` missing return value
1717
1718- Fixed `collection.replaceByExample(example, newValue, opts)` missing return value
1719
1720- Fixed `collection.updateByExample(example, newValue, opts)` missing return value
1721
1722## [6.2.2] - 2018-03-21
1723
1724### Fixed
1725
1726- Replaced `Object.values` use to improve Node version compatibility
1727
1728 This allows using arangojs in Node.js 6 LTS without a polyfill.
1729
1730## [6.2.1] - 2018-03-21
1731
1732### Changed
1733
1734- Moved most documentation out of the README ([#123](https://github.com/arangodb/arangojs/issues/123))
1735
1736 This is a necessary step to integrate arangojs with the Drivers book in the official ArangoDB documentation.
1737
1738- Replaced internal use of async functions with callbacks
1739
1740 This removes some unnecessary layers of indirection, which should increase overall performance.
1741
1742### Fixed
1743
1744- Increased test coverage ([#34](https://github.com/arangodb/arangojs/issues/34)).
1745
1746## [6.2.0] - 2018-03-06
1747
1748### Changed
1749
1750- Extended `db.transaction` arguments ([@f5io](https://github.com/f5io) in [#494](https://github.com/arangodb/arangojs/pull/494))
1751
1752 It's now possible to pass additional transaction options.
1753
1754### Fixed
1755
1756- Fixed `db.acquireHostList` request path ([@jcambass](https://github.com/jcambass) in [#504](https://github.com/arangodb/arangojs/pull/504))
1757
1758- Fixed a typo ([@lodestone](https://github.com/lodestone) in [#506](https://github.com/arangodb/arangojs/pull/506))
1759
1760- Fixed `graphEdgeCollection.edge` return value ([@Hunter21007](https://github.com/Hunter21007) in [#501](https://github.com/arangodb/arangojs/pull/501))
1761
1762- Fixed graph API sending incorrect requests resulting in HTTP 400 errors ([@casdevs](https://github.com/casdevs) in [#513](https://github.com/arangodb/arangojs/pull/513))
1763
1764## [6.1.0] - 2018-02-12
1765
1766### Removed
1767
1768- Removed ES modules build
1769
1770 This should solve compatibility problems with `es6-error`. The cjs
1771 build now should also work with emulated ES module imports.
1772
1773### Changed
1774
1775- Use `cpy-cli` for build process
1776
1777 Should help with cross-platform compatibility.
1778
1779### Fixed
1780
1781- Fixed `db.uninstallService(mount, opts)` opts default value
1782
1783- Fixed `db.getServiceConfiguration(mount, minimal)` minimal representation
1784
1785- Fixed `db.getServiceDependencies(mount, minimal)` minimal representation
1786
1787- Fixed `db.updateServiceConfiguration(mount, cfg, minimal)` non-minimal representation
1788
1789- Fixed `db.replaceServiceConfiguration(mount, cfg, minimal)` non-minimal representation
1790
1791- Fixed `db.updateServiceDependencies(mount, cfg, minimal)` non-minimal representation
1792
1793- Fixed `db.replaceServiceDependencies(mount, cfg, minimal)` non-minimal representation
1794
1795- Fixed handling of non-json responses
1796
1797## [6.0.1] - 2018-01-22
1798
1799### Changed
1800
1801- Use `rimraf` for build process
1802
1803 Should help with cross-platform compatibility.
1804
1805### Fixed
1806
1807- Fixed some imports broken during the TypeScript rewrite
1808
1809 If you were previously seeing errors involving a `default` property,
1810 this should make those go away.
1811
1812## [6.0.0] - 2018-01-11
1813
1814### Removed
1815
1816- Removed `retryConnection` config.
1817
1818 It is not possible to reliably determine whether retrying a request
1819 is safe or not at the driver level. If you need automatic retry, you
1820 should implement your own logic, e.g. using the
1821 [retry](https://yarnpkg.com/en/package/retry) package.
1822
1823- Removed `promise` config.
1824
1825 If you want to use an alternative promise implementation
1826 you need to overwrite the `Promise` global variable directly.
1827
1828- Asynchronous functions no longer support node-style callbacks.
1829
1830 All asynchronous functions now return promises.
1831
1832- Removed support for credentials in `url` config.
1833
1834 Use `db.useBasicAuth` or `db.useBearerAuth` to pass credentials instead.
1835
1836- Removed bower support.
1837
1838 Use yarn/npm instead.
1839
1840### Changed
1841
1842- Removed `lib` path prefix
1843
1844 All arangojs files can now be imported directly by name.
1845
1846 Before:
1847
1848 ```js
1849 import { DocumentCollection } from "arangojs/lib/collection";
1850 ```
1851
1852 After:
1853
1854 ```js
1855 import { DocumentCollection } from "arangojs/collection";
1856 ```
1857
1858- The `url` config can now also be an array of URLs.
1859
1860 The behavior depends on the load balancing strategy (see API docs).
1861
1862- The `databaseName` config has been replaced with `isAbsolute`.
1863
1864 If you previously used `databaseName: false`, the same behavior can now
1865 be achieved using `isAbsolute: true`. If you want to use a specific
1866 database you can still switch databases with `db.useDatabase` at any time.
1867
1868- Browser: maximum number of parallel connections behaves differently.
1869
1870 As keep-alive does not work reliably in the browser, the maximum number
1871 of parallel connections now matches `agentOptions.maxSockets` exactly.
1872
1873- TypeScript: ported arangojs to TypeScript.
1874
1875 The generated typings are now included in the NPM release and should
1876 be more reliable than the community maintained typings included with
1877 earlier versions of arangojs.
1878 See also [#480](https://github.com/arangodb/arangojs/issues/480).
1879
1880### Added
1881
1882- Added ES Modules and browser build to NPM release.
1883
1884 - ES Modules files live under `lib/esm/`
1885 - CommonJS files live under `lib/cjs/`
1886 - Precompiled browser build lives at `lib/web.js`
1887
1888- Added support for load balancing and failover.
1889
1890 See API documentation for details.
1891
1892- Added `acquireHostList` method.
1893
1894 See API documentation for details.
1895
1896- Added support for leader/follower failover.
1897
1898 Connections to a follower responding with an endpoint redirect
1899 will now be transparently redirected to the indicated leader.
1900
1901### Fixed
1902
1903- Fixed [#354](https://github.com/arangodb/arangojs/issues/354)
1904
1905 Graph methods now only return the relevant part of the response body.
1906
1907[9.0.0]: https://github.com/arangodb/arangojs/compare/v8.8.1...v9.0.0
1908[8.8.1]: https://github.com/arangodb/arangojs/compare/v8.8.0...v8.8.1
1909[8.8.0]: https://github.com/arangodb/arangojs/compare/v8.7.0...v8.8.0
1910[8.7.0]: https://github.com/arangodb/arangojs/compare/v8.6.0...v8.7.0
1911[8.6.0]: https://github.com/arangodb/arangojs/compare/v8.5.0...v8.6.0
1912[8.5.0]: https://github.com/arangodb/arangojs/compare/v8.4.1...v8.5.0
1913[8.4.1]: https://github.com/arangodb/arangojs/compare/v8.4.0...v8.4.1
1914[8.4.0]: https://github.com/arangodb/arangojs/compare/v8.3.1...v8.4.0
1915[8.3.1]: https://github.com/arangodb/arangojs/compare/v8.3.0...v8.3.1
1916[8.3.0]: https://github.com/arangodb/arangojs/compare/v8.2.1...v8.3.0
1917[8.2.1]: https://github.com/arangodb/arangojs/compare/v8.2.0...v8.2.1
1918[8.2.0]: https://github.com/arangodb/arangojs/compare/v8.1.0...v8.2.0
1919[8.1.0]: https://github.com/arangodb/arangojs/compare/v8.0.0...v8.1.0
1920[8.0.0]: https://github.com/arangodb/arangojs/compare/v7.8.0...v8.0.0
1921[7.8.0]: https://github.com/arangodb/arangojs/compare/v7.7.0...v7.8.0
1922[7.7.0]: https://github.com/arangodb/arangojs/compare/v7.6.1...v7.7.0
1923[7.6.1]: https://github.com/arangodb/arangojs/compare/v7.6.0...v7.6.1
1924[7.6.0]: https://github.com/arangodb/arangojs/compare/v7.5.0...v7.6.0
1925[7.5.0]: https://github.com/arangodb/arangojs/compare/v7.4.0...v7.5.0
1926[7.4.0]: https://github.com/arangodb/arangojs/compare/v7.3.0...v7.4.0
1927[7.3.0]: https://github.com/arangodb/arangojs/compare/v7.2.0...v7.3.0
1928[7.2.0]: https://github.com/arangodb/arangojs/compare/v7.1.1...v7.2.0
1929[7.1.1]: https://github.com/arangodb/arangojs/compare/v7.1.0...v7.1.1
1930[7.1.0]: https://github.com/arangodb/arangojs/compare/v7.0.2...v7.1.0
1931[7.0.2]: https://github.com/arangodb/arangojs/compare/v7.0.1...v7.0.2
1932[7.0.1]: https://github.com/arangodb/arangojs/compare/v7.0.0...v7.0.1
1933[7.0.0]: https://github.com/arangodb/arangojs/compare/v6.14.1...v7.0.0
1934[6.14.1]: https://github.com/arangodb/arangojs/compare/v6.14.0...v6.14.1
1935[6.14.0]: https://github.com/arangodb/arangojs/compare/v6.13.0...v6.14.0
1936[6.13.0]: https://github.com/arangodb/arangojs/compare/v6.12.0...v6.13.0
1937[6.12.0]: https://github.com/arangodb/arangojs/compare/v6.11.1...v6.12.0
1938[6.11.1]: https://github.com/arangodb/arangojs/compare/v6.11.0...v6.11.1
1939[6.11.0]: https://github.com/arangodb/arangojs/compare/v6.10.0...v6.11.0
1940[6.10.0]: https://github.com/arangodb/arangojs/compare/v6.9.0...v6.10.0
1941[6.9.0]: https://github.com/arangodb/arangojs/compare/v6.8.0...v6.9.0
1942[6.8.0]: https://github.com/arangodb/arangojs/compare/v6.7.0...v6.8.0
1943[6.7.0]: https://github.com/arangodb/arangojs/compare/v6.6.0...v6.7.0
1944[6.6.0]: https://github.com/arangodb/arangojs/compare/v6.5.1...v6.6.0
1945[6.5.1]: https://github.com/arangodb/arangojs/compare/v6.5.0...v6.5.1
1946[6.5.0]: https://github.com/arangodb/arangojs/compare/v6.4.0...v6.5.0
1947[6.4.0]: https://github.com/arangodb/arangojs/compare/v6.3.0...v6.4.0
1948[6.3.0]: https://github.com/arangodb/arangojs/compare/v6.2.4...v6.3.0
1949[6.2.4]: https://github.com/arangodb/arangojs/compare/v6.2.3...v6.2.4
1950[6.2.3]: https://github.com/arangodb/arangojs/compare/v6.2.2...v6.2.3
1951[6.2.2]: https://github.com/arangodb/arangojs/compare/v6.2.1...v6.2.2
1952[6.2.1]: https://github.com/arangodb/arangojs/compare/v6.2.0...v6.2.1
1953[6.2.0]: https://github.com/arangodb/arangojs/compare/v6.1.0...v6.2.0
1954[6.1.0]: https://github.com/arangodb/arangojs/compare/v6.0.1...v6.1.0
1955[6.0.1]: https://github.com/arangodb/arangojs/compare/v6.0.0...v6.0.1
1956[6.0.0]: https://github.com/arangodb/arangojs/compare/v5.8.0...v6.0.0
1957
\No newline at end of file