Skip to content

DynamoDB  >  Operations  >  transact_get_items

transact_get_items

Operation

transact_get_items async

transact_get_items(input: TransactGetItemsInput, plugins: list[Plugin] | None = None) -> TransactGetItemsOutput

TransactGetItems is a synchronous operation that atomically retrieves multiple items from one or more tables (but not from indexes) in a single account and Region. A TransactGetItems call can contain up to 100 TransactGetItem objects, each of which contains a Get structure that specifies an item to retrieve from a table in the account and Region. A call to TransactGetItems cannot retrieve items from tables in more than one Amazon Web Services account or Region. The aggregate size of the items in the transaction cannot exceed 4 MB.

DynamoDB rejects the entire TransactGetItems request if any of the following is true:

  • A conflicting operation is in the process of updating an item to be read.

  • There is insufficient provisioned capacity for the transaction to be completed.

  • There is a user error, such as an invalid data format.

  • The aggregate size of the items in the transaction exceeded 4 MB.

Parameters:

Name Type Description Default
input TransactGetItemsInput

An instance of TransactGetItemsInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
TransactGetItemsOutput

An instance of TransactGetItemsOutput.

Input

TransactGetItemsInput dataclass

Dataclass for TransactGetItemsInput structure.

Attributes

return_consumed_capacity class-attribute instance-attribute
return_consumed_capacity: ReturnConsumedCapacity | None = None

A value of TOTAL causes consumed capacity information to be returned, and a value of NONE prevents that information from being returned. No other value is valid.

transact_items class-attribute instance-attribute
transact_items: list[TransactGetItem] | None = None

An ordered array of up to 100 TransactGetItem objects, each of which contains a Get structure.

Output

TransactGetItemsOutput dataclass

Dataclass for TransactGetItemsOutput structure.

Attributes

consumed_capacity class-attribute instance-attribute
consumed_capacity: list[ConsumedCapacity] | None = None

If the ReturnConsumedCapacity value was TOTAL, this is an array of ConsumedCapacity objects, one for each table addressed by TransactGetItem objects in the TransactItems parameter. These ConsumedCapacity objects report the read-capacity units consumed by the TransactGetItems call in that table.

responses class-attribute instance-attribute
responses: list[ItemResponse] | None = None

An ordered array of up to 100 ItemResponse objects, each of which corresponds to the TransactGetItem object in the same position in the TransactItems array. Each ItemResponse object contains a Map of the name-value pairs that are the projected attributes of the requested item.

If a requested item could not be retrieved, the corresponding ItemResponse object is Null, or if the requested item has no projected attributes, the corresponding ItemResponse object is an empty Map.