Skip to content

Commit a7165fe

Browse files
committed
Add missing CollectionInsertOptions options
1 parent e52ad75 commit a7165fe

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ This driver uses semantic versioning:
2222

2323
## Added
2424

25+
- Added `returnOld` and `mergeObjects` to `CollectionInsertOptions` type
26+
27+
These options are only available when using `overwriteMode`.
28+
2529
- Added caching options to `InvertedIndex` and `ArangoSearchView` types
2630

2731
These options were added in ArangoDB 3.10.2.

src/collection.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,13 +683,30 @@ export type CollectionInsertOptions = {
683683
* Default: `false`
684684
*/
685685
returnNew?: boolean;
686+
/**
687+
* If set to `true`, the complete old document will be returned as the `old`
688+
* property on the result object. Has no effect if `silent` is set to `true`.
689+
* This option is only available when `overwriteMode` is set to `"update"` or
690+
* `"replace"`.
691+
*
692+
* Default: `false`
693+
*/
694+
returnOld?: boolean;
686695
/**
687696
* Defines what should happen if a document with the same `_key` or `_id`
688697
* already exists, instead of throwing an exception.
689698
*
690699
* Default: `"conflict"
691700
*/
692701
overwriteMode?: "ignore" | "update" | "replace" | "conflict";
702+
/**
703+
* If set to `false`, object properties that already exist in the old
704+
* document will be overwritten rather than merged when an existing document
705+
* with the same `_key` or `_id` is updated. This does not affect arrays.
706+
*
707+
* Default: `true`
708+
*/
709+
mergeObjects?: boolean;
693710
};
694711

695712
/**

0 commit comments

Comments
 (0)