Skip to content

Commit 9fba2cc

Browse files
author
Corey Earwood
committed
feat(transact-item-limit): increase transact write items limit to 25
Amazon has increased the TransacactWriteItems limit to 25 https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-apis.html#transaction-apis-txwriteitems
1 parent 58db062 commit 9fba2cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dynamo/transactwrite/transact-write.request.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { DynamoDbWrapper } from '../dynamo-db-wrapper'
66
import { TransactOperation } from './transact-operation.type'
77

88
/**
9-
* Request class for the TransactWriteItems operation. Write up to 10 items to one or many tables in a transaction.
9+
* Request class for the TransactWriteItems operation. Write up to 25 items to one or many tables in a transaction.
1010
*/
1111
export class TransactWriteRequest {
1212
get dynamoDB(): DynamoDB {
@@ -40,16 +40,16 @@ export class TransactWriteRequest {
4040
}
4141

4242
/**
43-
* add up to 10 transaction operations
43+
* add up to 25 transaction operations
4444
* create the operations with:
4545
* {@link TransactConditionCheck}, {@link TransactDelete}, {@link TransactPut}, {@link TransactUpdate}
4646
*/
4747
transact(...writeOperations: TransactOperation[]): this {
4848
if (!writeOperations || writeOperations.length === 0) {
4949
throw new Error('at least one transaction operation must be added')
5050
}
51-
if (this.params.TransactItems.length + writeOperations.length > 10) {
52-
throw new Error(`Each transaction can include up to 10 unique items, including conditions.\
51+
if (this.params.TransactItems.length + writeOperations.length > 25) {
52+
throw new Error(`Each transaction can include up to 25 unique items, including conditions.\
5353
Given operations count: ${this.params.TransactItems.length + writeOperations.length}`)
5454
}
5555
this.params.TransactItems.push(...writeOperations.map((wo) => wo.transactItem))

0 commit comments

Comments
 (0)