Skip to content

Commit 987d9e0

Browse files
committed
Implement versionAttribute
Fixes DE-783.
1 parent 54ca077 commit 987d9e0

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ This driver uses semantic versioning:
1414
- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
1515
changes that require changes in your code to upgrade.
1616

17+
## [Unreleased]
18+
19+
### Added
20+
21+
- Added the `versionAttribute` option to the document operation options types (DE-783)
22+
1723
## [8.8.0]
1824

1925
### Changed
@@ -1788,6 +1794,7 @@ For a detailed list of changes between pre-release versions of v7 see the
17881794

17891795
Graph methods now only return the relevant part of the response body.
17901796

1797+
[unreleased]: https://github.com/arangodb/arangojs/compare/v8.8.0...HEAD
17911798
[8.8.0]: https://github.com/arangodb/arangojs/compare/v8.7.0...v8.8.0
17921799
[8.7.0]: https://github.com/arangodb/arangojs/compare/v8.6.0...v8.7.0
17931800
[8.6.0]: https://github.com/arangodb/arangojs/compare/v8.5.0...v8.6.0

src/collection.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,13 @@ export type CollectionInsertOptions = {
743743
* Default: `false`
744744
*/
745745
refillIndexCaches?: boolean;
746+
/**
747+
* If set, the attribute with the name specified by the option is looked up
748+
* in the stored document and the attribute value is compared numerically to
749+
* the value of the versioning attribute in the supplied document that is
750+
* supposed to update/replace it.
751+
*/
752+
versionAttribute?: string;
746753
};
747754

748755
/**
@@ -796,6 +803,13 @@ export type CollectionReplaceOptions = {
796803
* Default: `false`
797804
*/
798805
refillIndexCaches?: boolean;
806+
/**
807+
* If set, the attribute with the name specified by the option is looked up
808+
* in the stored document and the attribute value is compared numerically to
809+
* the value of the versioning attribute in the supplied document that is
810+
* supposed to update/replace it.
811+
*/
812+
versionAttribute?: string;
799813
};
800814

801815
/**
@@ -864,6 +878,13 @@ export type CollectionUpdateOptions = {
864878
* Default: `false`
865879
*/
866880
refillIndexCaches?: boolean;
881+
/**
882+
* If set, the attribute with the name specified by the option is looked up
883+
* in the stored document and the attribute value is compared numerically to
884+
* the value of the versioning attribute in the supplied document that is
885+
* supposed to update/replace it.
886+
*/
887+
versionAttribute?: string;
867888
};
868889

869890
/**

0 commit comments

Comments
 (0)