Skip to content

Commit 332e251

Browse files
committed
Add further docs
1 parent d14fbc4 commit 332e251

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ and this project adheres to
1313
### Added
1414

1515
- Support `consistentRead` option on `get` API
16+
17+
## 1.5.0 - 2021-10-27
18+
19+
### Added
20+
21+
- Support optimistic locking for `put`, `update` and `delete` APIs

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,19 @@ available toggles:
151151
provide the current version number. If an out-of-date version number is
152152
supplied, an error will be thrown.
153153

154+
Example of Dao constructed with optimistic locking enabled.
155+
156+
```
157+
const dao = new DynamoDbDao<DataModel, KeySchema>({
158+
tableName,
159+
documentClient,
160+
optimisticLockingAttribute: 'version',
161+
});
162+
```
163+
154164
2. If you wish to ignore optimistic locking for a save operation, specify
155-
`ignoreOptimisticLocking: true` on your `put`, `update`, or `delete`.
165+
`ignoreOptimisticLocking: true` in the options on your `put`, `update`, or
166+
`delete`.
156167

157168
NOTE: Optimistic locking is NOT supported for `batchWrite` or `batchPut`
158169
operations. Consuming those APIs for data models that do have optimistic locking

0 commit comments

Comments
 (0)