TransactGetItems

Documentation

Groups up to 100 GET actions in a single all-or-nothing operation.

Combined size of items in the transaction cannot exceed 4 MB

A read transaction can contain up to 100 Get action together. Only read action can be carried out:

  • Get initiates a GetItem operation to retrieve the item identified by primary key.

    • Indexes cannot be used
    • Null returned for non-existent item
    • Projections is supported
    • Cannot include same item more than once

Example


aws dynamodb transact-get-items \
   --transact-items  '[
            {
                "Get": {
                    "TableName": "FlashSaleDiscounts",
                    "Key": {
                        "PK": {"S":"DISCOUNT#100"}, 
                        "SK": {"S":"DISCOUNT#100"}
                    }
                }
            },
            {
                "Get": {
                    "TableName": "FlashSaleDiscounts",
                    "Key": {
                        "PK": {"S":"DISCOUNT#101"}, 
                        "SK": {"S":"DISCOUNT#101"}
                    }
                }
            },
            {
                "Get": {
                    "TableName": "FlashSaleDiscounts",
                    "Key": {
                        "PK": {"S":"DISCOUNT#102"}, 
                        "SK": {"S":"DISCOUNT#102"}
                    }
                }
            }            
        ]'  \
    --endpoint-url http://localhost:8000