Request class for the UpdateItem operation.

### Type parameters

- #### T

### Hierarchy

- WriteRequest<T, UpdateItemInput, UpdateItemOutput, UpdateRequest<T>>
  - UpdateRequest

## Index

### Constructors

- constructor

### Properties

- dynamoDBWrapper
- logger
- metadata
- modelClazz
- params
- tableName

### Methods

- doRequest
- exec
- execFullResponse
- execNoMap
- onlyIf
- onlyIfAttribute
- operations
- returnConsumedCapacity
- returnItemCollectionMetrics
- returnValues
- updateAttribute

## Constructors

### constructor

- new UpdateRequest(dynamoDBWrapper: DynamoDbWrapper, modelClazz: ModelConstructor<T>, partitionKey: any, sortKey?: any): UpdateRequest

- Overrides WriteRequest.constructor

  - Defined in dynamo/request/update/update.request.ts:31

  #### Parameters

  - ##### dynamoDBWrapper: DynamoDbWrapper

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

  - ##### partitionKey: any

  - ##### Optional sortKey: any

  #### Returns UpdateRequest

## Properties

### dynamoDBWrapper

dynamoDBWrapper: DynamoDbWrapper

Inherited from BaseRequest.dynamoDBWrapper

- Defined in dynamo/request/base.request.ts:29

### Protected logger

logger: Logger

Overrides WriteRequest.logger

- Defined in dynamo/request/update/update.request.ts:31

### metadata

metadata: Metadata<T>

Inherited from BaseRequest.metadata

- Defined in dynamo/request/base.request.ts:39

metadata created from modelClazz

### modelClazz

modelClazz: ModelConstructor<T>

Inherited from BaseRequest.modelClazz

- Defined in dynamo/request/base.request.ts:34

corresponding Model Class

### params

params: UpdateItemInput

Inherited from BaseRequest.params

- Defined in dynamo/request/base.request.ts:49

request input object

### tableName

tableName: string

Inherited from BaseRequest.tableName

- Defined in dynamo/request/base.request.ts:44

tableName created with configured tableNameResolver function

## Methods

### Protected doRequest

- doRequest(params: UpdateItemInput): Promise<UpdateItemOutput>

- Overrides WriteRequest.doRequest

  - Defined in dynamo/request/update/update.request.ts:64

  #### Parameters

  - ##### params: UpdateItemInput

  #### Returns Promise<UpdateItemOutput>

### exec

- exec(): Promise<void>

- Inherited from WriteRequest.exec

  Overrides BaseRequest.exec

  - Defined in dynamo/request/write.request.ts:74

  #### Returns Promise<void>

  if no ReturnValues are requested, { T } if the requested ReturnValues are ALL_OLD|ALL_NEW or {Partial} if the requested ReturnValues are UPDATED_OLD|UPDATED_NEW

### execFullResponse

- execFullResponse(): Promise<WriteResponse<UpdateItemOutput, T>>

- Inherited from WriteRequest.execFullResponse

  Overrides BaseRequest.execFullResponse

  - Defined in dynamo/request/write.request.ts:86

  execute request and return the full response

  #### Returns Promise<WriteResponse<UpdateItemOutput, T>>

### execNoMap

- execNoMap(): Promise<UpdateItemOutput>

- Inherited from WriteRequest.execNoMap

  - Defined in dynamo/request/write.request.ts:109

  execute request without parsing (mapping) the response attributes to js objects

  #### Returns Promise<UpdateItemOutput>

### onlyIf

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

- Inherited from WriteRequest.onlyIf

  - Defined in dynamo/request/write.request.ts:65
  example

    writeRequest.onlyIf( attribute('age').eq(23) )

  example

    writeRequest.onlyIf( or( attribute('age').lt(18), attribute('age').gt(65) ) )

  #### Parameters

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

  #### Returns UpdateRequest<T>

### onlyIfAttribute

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

- Inherited from WriteRequest.onlyIfAttribute

  - Defined in dynamo/request/write.request.ts:55

  add a condition for propertyPath

  #### Type parameters

  - #### K: keyof T

  #### Parameters

  - ##### attributePath: K

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

- Inherited from WriteRequest.onlyIfAttribute

  - Defined in dynamo/request/write.request.ts:56

  #### Parameters

  - ##### attributePath: string

  #### Returns RequestConditionFunction<UpdateRequest<T>, T>

### operations

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

- - Defined in dynamo/request/update/update.request.ts:51

  add multiple update operations comma separated

  example

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

  #### Parameters

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

  #### Returns UpdateRequest<T>

### returnConsumedCapacity

- returnConsumedCapacity(level: DynamoDB.ReturnConsumedCapacity): UpdateRequest<T>

- Inherited from BaseRequest.returnConsumedCapacity

  - Defined in dynamo/request/base.request.ts:75

  return ConsumedCapacity of the corresponding table(s) in the response

  #### Parameters

  - ##### level: DynamoDB.ReturnConsumedCapacity

    not all requests support all values

  #### Returns UpdateRequest<T>

### returnItemCollectionMetrics

- returnItemCollectionMetrics(returnItemCollectionMetrics: DynamoDB.ReturnItemCollectionMetrics): UpdateRequest<T>

- Inherited from WriteRequest.returnItemCollectionMetrics

  - Defined in dynamo/request/write.request.ts:46

  return item collection metrics.

  #### Parameters

  - ##### returnItemCollectionMetrics: DynamoDB.ReturnItemCollectionMetrics

  #### Returns UpdateRequest<T>

### returnValues

- returnValues(returnValues: "ALL_OLD" | "ALL_NEW"): UpdateRequestReturnT<T>
- returnValues(returnValues: "UPDATED_OLD" | "UPDATED_NEW"): UpdateRequestReturnPartialT<T>
- returnValues(returnValues: "NONE"): UpdateRequest<T>

- - Defined in dynamo/request/update/update.request.ts:56

  #### Parameters

  - ##### returnValues: "ALL_OLD" | "ALL_NEW"

  #### Returns UpdateRequestReturnT<T>

- - Defined in dynamo/request/update/update.request.ts:57

  #### Parameters

  - ##### returnValues: "UPDATED_OLD" | "UPDATED_NEW"

  #### Returns UpdateRequestReturnPartialT<T>

- - Defined in dynamo/request/update/update.request.ts:58

  #### Parameters

  - ##### returnValues: "NONE"

  #### Returns UpdateRequest<T>

### updateAttribute

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

- - Defined in dynamo/request/update/update.request.ts:43

  create and add a single update operation

  example

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

  #### Type parameters

  - #### K: keyof T

  #### Parameters

  - ##### attributePath: K

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