Skip to content

Commit 537de08

Browse files
committed
Changes for 3.7.0
1 parent 9764c84 commit 537de08

File tree

4 files changed

+96
-2
lines changed

4 files changed

+96
-2
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ This driver uses semantic versioning:
2020

2121
- Renamed `validation` option to `schema` ([#681](https://github.com/arangodb/arangojs/issues/681))
2222

23+
### Added
24+
25+
- Added support for `isDisjoint` option in Graph API
26+
27+
- Added support for values `"ignore"` and `"conflict"` in `overwriteMode`
28+
option when saving documents using the Collection API
29+
30+
- Added support for `primarySortCompression` and `storedValues` options in
31+
View API
32+
2333
## [7.0.0-rc.1] - 2020-07-11
2434

2535
### Fixed

src/collection.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,10 @@ export type CollectionInsertOptions = {
575575
/**
576576
* Defines what should happen if a document with the same `_key` or `_id`
577577
* already exists, instead of throwing an exception.
578+
*
579+
* Default: `"conflict"
578580
*/
579-
overwriteMode?: "update" | "replace";
581+
overwriteMode?: "ignore" | "update" | "replace" | "conflict";
580582
};
581583

582584
/**

src/graph.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ export type GraphInfo = {
274274
* @deprecated Renamed to `writeConcern` in ArangoDB 3.6.
275275
*/
276276
minReplicationFactor?: number;
277+
/**
278+
* (Enterprise Edition cluster only.) If set to `true`, the graph is a
279+
* SatelliteGraph.
280+
*/
281+
isSatellite?: boolean;
277282
/**
278283
* (Enterprise Edition cluster only.) If set to `true`, the graph has been
279284
* created as a SmartGraph.
@@ -284,6 +289,11 @@ export type GraphInfo = {
284289
* value to use for smart sharding.
285290
*/
286291
smartGraphAttribute?: string;
292+
/**
293+
* (Enterprise Edition cluster only.) If set to `true`, the graph has been
294+
* created as a Disjoint SmartGraph.
295+
*/
296+
isDisjoint?: boolean;
287297
};
288298

289299
/**
@@ -306,6 +316,8 @@ export type GraphCreateOptions = {
306316
/**
307317
* (Cluster only.) Number of shards that is used for every collection
308318
* within this graph.
319+
*
320+
* Has no effect when `replicationFactor` is set to `"satellite"`.
309321
*/
310322
numberOfShards?: number;
311323
/**
@@ -317,11 +329,15 @@ export type GraphCreateOptions = {
317329
replicationFactor?: number | "satellite";
318330
/**
319331
* (Cluster only.) Write concern for new collections in the graph.
332+
*
333+
* Has no effect when `replicationFactor` is set to `"satellite"`.
320334
*/
321335
writeConcern?: number;
322336
/**
323337
* (Cluster only.) Write concern for new collections in the graph.
324338
*
339+
* Has no effect when `replicationFactor` is set to `"satellite"`.
340+
*
325341
* @deprecated Renamed to `writeConcern` in ArangoDB 3.6.
326342
*/
327343
minReplicationFactor?: number;
@@ -341,6 +357,13 @@ export type GraphCreateOptions = {
341357
* **Note**: `isSmart` must be set to `true`.
342358
*/
343359
smartGraphAttribute?: string;
360+
/**
361+
* (Enterprise Edition cluster only.) If set to `true`, the graph will be
362+
* created as a Disjoint SmartGraph.
363+
*
364+
* Default: `false`
365+
*/
366+
isDisjoint?: boolean;
344367
};
345368

346369
/**
@@ -1250,7 +1273,8 @@ export class Graph {
12501273
edgeDefinitions: EdgeDefinitionOptions[],
12511274
options?: GraphCreateOptions
12521275
): Promise<GraphInfo> {
1253-
const { orphanCollections, waitForSync, isSmart, ...opts } = options || {};
1276+
const { orphanCollections, waitForSync, isSmart, isDisjoint, ...opts } =
1277+
options || {};
12541278
return this._db.request(
12551279
{
12561280
method: "POST",
@@ -1263,6 +1287,7 @@ export class Graph {
12631287
: [collectionToString(orphanCollections)]),
12641288
edgeDefinitions: edgeDefinitions.map(coerceEdgeDefinition),
12651289
isSmart,
1290+
isDisjoint,
12661291
name: this._name,
12671292
options: opts,
12681293
},

src/view.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,39 @@ export type ArangoSearchViewProperties = {
115115
* merged.
116116
*/
117117
consolidationPolicy: BytesAccumConsolidationPolicy | TierConsolidationPolicy;
118+
/**
119+
* Attribute path (`field`) for the value of each document that is
120+
* used for sorting.
121+
*/
122+
primarySort: {
123+
/**
124+
* Attribute path for the value of each document used for
125+
* sorting.
126+
*/
127+
field: string;
128+
/**
129+
* If set to `"asc"`, the primary sorting order is ascending.
130+
* If set to `"desc"`, the primary sorting order is descending.
131+
*/
132+
direction: "desc" | "asc";
133+
}[];
134+
/**
135+
* Compression to use for the primary sort data.
136+
*
137+
* Default: `"lz4"`
138+
*/
139+
primarySortCompression: PrimarySortCompression;
140+
/**
141+
* Attribute paths for which values should be stored in the view index
142+
* in addition to those used for sorting via `primarySort`.
143+
*/
144+
storedValues: {
145+
/**
146+
* Attribute paths for which values should be stored in the view index
147+
* in addition to those used for sorting via `primarySort`.
148+
*/
149+
fields: string[];
150+
}[];
118151
/**
119152
* An object mapping names of linked collections to
120153
* {@link ArangoSearchViewLink} definitions.
@@ -179,6 +212,13 @@ export type TierConsolidationPolicy = {
179212
minScore?: number;
180213
};
181214

215+
/**
216+
* Compression to use for primary sort data of a View.
217+
*
218+
* Default: `"lz4"`
219+
*/
220+
export type PrimarySortCompression = "lz4" | "none";
221+
182222
/**
183223
* Properties of an ArangoSearch View.
184224
*/
@@ -261,6 +301,23 @@ export type ArangoSearchViewPropertiesOptions = {
261301
asc: boolean;
262302
}
263303
)[];
304+
/**
305+
* Compression to use for the primary sort data.
306+
*
307+
* Default: `"lz4"`
308+
*/
309+
primarySortCompression?: PrimarySortCompression;
310+
/**
311+
* Attribute paths for which values should be stored in the view index
312+
* in addition to those used for sorting via `primarySort`.
313+
*/
314+
storedValues?: {
315+
/**
316+
* Attribute paths for which values should be stored in the view index
317+
* in addition to those used for sorting via `primarySort`.
318+
*/
319+
fields: string[];
320+
}[];
264321
/**
265322
* An object mapping names of linked collections to
266323
* {@link ArangoSearchViewLink} definitions.

0 commit comments

Comments
 (0)