TransactOperation class for transactional update items.

### Type parameters

- #### T

### Hierarchy

- TransactBaseOperation<T, Update, TransactUpdate<T>>
  - TransactUpdate

### Implements

- ConditionalParamsHost

## Index

### Constructors

- constructor

### Properties

- metadata
- modelClazz
- params

### Accessors

- transactItem

### Methods

- onlyIf
- onlyIfAttribute
- operations
- returnValuesOnConditionCheckFailure
- updateAttribute

## Constructors

### constructor

- new TransactUpdate(modelClazz: ModelConstructor<T>, partitionKey: any, sortKey?: any): TransactUpdate

- Overrides TransactBaseOperation.constructor

  - Defined in dynamo/transactwrite/transact-update.ts:16

  #### Parameters

  - ##### modelClazz: ModelConstructor<T>

  - ##### partitionKey: any

  - ##### Optional sortKey: any

  #### Returns TransactUpdate

## Properties

### metadata

metadata: Metadata<T>

Inherited from TransactBaseOperation.metadata

- Defined in dynamo/transactwrite/transact-base-operation.ts:26

### modelClazz

modelClazz: ModelConstructor<T>

Inherited from TransactBaseOperation.modelClazz

- Defined in dynamo/transactwrite/transact-base-operation.ts:27

### params

params: Update

Inherited from TransactBaseOperation.params

- Defined in dynamo/transactwrite/transact-base-operation.ts:25

## Accessors

### transactItem

transactItem:

Overrides TransactBaseOperation.transactItem

- Defined in dynamo/transactwrite/transact-update.ts:39

## Methods

### onlyIf

- onlyIf(...conditionDefFns: ConditionExpressionDefinitionFunction[]): TransactUpdate<T>

- Inherited from TransactBaseOperation.onlyIf

  - Defined in dynamo/transactwrite/transact-base-operation.ts:61

  add a condition necessary for the transaction to succeed

  example

    req.onlyIf(or(attribute('age').lt(10), attribute('age').gt(20)))

  #### Parameters

  - ##### Rest ...conditionDefFns: ConditionExpressionDefinitionFunction[]

  #### Returns TransactUpdate<T>

### onlyIfAttribute

- onlyIfAttribute<K>(attributePath: K): RequestConditionFunctionTyped<TransactUpdate<T>, T, K>
- onlyIfAttribute(attributePath: string): RequestConditionFunction<TransactUpdate<T>, T>

- Inherited from TransactBaseOperation.onlyIfAttribute

  - Defined in dynamo/transactwrite/transact-base-operation.ts:51

  create a condition on given attributePath

  example

    req.onlyIfAttribute('age').lt(10)

  #### Type parameters

  - #### K: keyof T

  #### Parameters

  - ##### attributePath: K

  #### Returns RequestConditionFunctionTyped<TransactUpdate<T>, T, K>

- Inherited from TransactBaseOperation.onlyIfAttribute

  - Defined in dynamo/transactwrite/transact-base-operation.ts:52

  #### Parameters

  - ##### attributePath: string

  #### Returns RequestConditionFunction<TransactUpdate<T>, T>

### operations

- operations(...updateDefFns: UpdateExpressionDefinitionFunction[]): TransactUpdate<T>

- - Defined in dynamo/transactwrite/transact-update.ts:34

  add multiple update ops

  example

    updtTrans.operations(update('path.to.attr).set('newVal'), ... )

  #### Parameters

  - ##### Rest ...updateDefFns: UpdateExpressionDefinitionFunction[]

  #### Returns TransactUpdate<T>

### returnValuesOnConditionCheckFailure

- returnValuesOnConditionCheckFailure(value: DynamoDB.ReturnValuesOnConditionCheckFailure): TransactUpdate<T>

- Inherited from TransactBaseOperation.returnValuesOnConditionCheckFailure

  - Defined in dynamo/transactwrite/transact-base-operation.ts:70

  get the item attributes if the condition fails

  #### Parameters

  - ##### value: DynamoDB.ReturnValuesOnConditionCheckFailure

  #### Returns TransactUpdate<T>

### updateAttribute

- updateAttribute<K>(attributePath: K): RequestUpdateFunction<TransactUpdate<T>, T, K>

- - Defined in dynamo/transactwrite/transact-update.ts:26

  create and add a single update operation

  example

    updtTrans.updateAttribute('path.to.attr').set('newVal')

  #### Type parameters

  - #### K: keyof T

  #### Parameters

  - ##### attributePath: K

  #### Returns RequestUpdateFunction<TransactUpdate<T>, T, K>