CmdID

CmdID / aws / aws dynamodb

aws dynamodb transact-get-items

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. AWS CLI reference

1 example 2 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

To retrieve multiple items atomically from one or more tables

The following transact-get-items example retrieves multiple items atomically.

aws dynamodb transact-get-items --transact-items file://transact-items.json --return-consumed-capacity TOTALIdentify
--transact-itemsAn ordered array of up to 100 TransactGetItem objects, each of which contains a Get structure.
--return-consumed-capacityA value of TOTAL causes consumed capacity information to be returned, and a value of NONE prevents that information from being returned.

Contents of transact-items.json:

[
    {
        "Get": {
            "Key": {
                "Artist": {"S": "Acme Band"},
                "SongTitle": {"S": "Happy Day"}
            },
            "TableName": "MusicCollection"
        }
    },
    {
        "Get": {
            "Key": {
                "Artist": {"S": "No One You Know"},
                "SongTitle": {"S": "Call Me Today"}
            },
            "TableName": "MusicCollection"
        }
    }
]
Its output, shortened
{
    "ConsumedCapacity": [
        {
            "TableName": "MusicCollection",
            "CapacityUnits": 4.0,
            "ReadCapacityUnits": 4.0
        }
    ],
    "Responses": [
        {
            "Item": {
                "AlbumTitle": {
                    "S": "Songs About Life"
                },
                "Artist": {
                    "S": "Acme Band"
                },
                "SongTitle": {
                    "S": "Happy Day"
                }
            }
        },
        {
            "Item": {
                "AlbumTitle": {
                    "S": "Somewhat Famous"
                },
                "Artist": {
                    "S": "No One You Know"
                },
… 7 more lines

For more information, see Managing Complex Workflows with DynamoDB Transactions in the Amazon DynamoDB Developer Guide.

Options

2 in the AWS CLI reference
--return-consumed-capacityA value of TOTAL causes consumed capacity information to be returned, and a value of NONE prevents that information from being returned.
--transact-itemsAn ordered array of up to 100 TransactGetItem objects, each of which contains a Get structure.