Class DynamoDbClient
Client to interact with Amazon DynamoDB
- Guzzle\Common\AbstractHasDispatcher implements Guzzle\Common\HasDispatcherInterface
-
Guzzle\Http\Client implements Guzzle\Http\ClientInterface
-
Guzzle\Service\Client implements Guzzle\Service\ClientInterface
-
Aws\Common\Client\AbstractClient implements Aws\Common\Client\AwsClientInterface
-
Aws\DynamoDb_2011_12_05\DynamoDbClient
Link: User guide
Link: API docs
Located at Aws/DynamoDb_2011_12_05/DynamoDbClient.php
Methods summary
-
public static
factory ( array|Collection $config = array() )
Factory method to create a new Amazon DynamoDB client using an array of configuration options.
-
public
batchGetItem ( array $args = array() )
Executes the BatchGetItem operation.
-
public
batchWriteItem ( array $args = array() )
Executes the BatchWriteItem operation.
-
public
createTable ( array $args = array() )
Executes the CreateTable operation.
-
public
deleteItem ( array $args = array() )
Executes the DeleteItem operation.
-
public
deleteTable ( array $args = array() )
Executes the DeleteTable operation.
-
public
describeTable ( array $args = array() )
Executes the DescribeTable operation.
-
public
getItem ( array $args = array() )
Executes the GetItem operation.
-
public
listTables ( array $args = array() )
Executes the ListTables operation.
-
public
putItem ( array $args = array() )
Executes the PutItem operation.
-
public
query ( array $args = array() )
Executes the Query operation.
-
public
scan ( array $args = array() )
Executes the Scan operation.
-
public
updateItem ( array $args = array() )
Executes the UpdateItem operation.
-
public
updateTable ( array $args = array() )
Executes the UpdateTable operation.
-
public
waitUntilTableExists ( array $input )
Wait until a table exists and can be accessed The input array uses the parameters of the DescribeTable operation and waiter specific settings
-
public
waitUntilTableNotExists ( array $input )
Wait until a table is deleted The input array uses the parameters of the DescribeTable operation and waiter specific settings
-
public
getBatchGetItemIterator ( array $args = array() )
The input array uses the parameters of the BatchGetItem operation
-
public
getListTablesIterator ( array $args = array() )
The input array uses the parameters of the ListTables operation
-
public
getQueryIterator ( array $args = array() )
The input array uses the parameters of the Query operation
-
public
getScanIterator ( array $args = array() )
The input array uses the parameters of the Scan operation
Methods detail
public static
Aws\DynamoDb_2011_12_05\DynamoDbClient
factory( array|Guzzle\Common\Collection
$config = array() )
Factory method to create a new Amazon DynamoDB client using an array of configuration options.
See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
Parameters
- $config
array|
Guzzle\Common\Collection
$config Client configuration data
Returns
Link
Overrides
Executes the BatchGetItem operation.
Retrieves the attributes for multiple items from multiple tables using their primary keys.
The maximum number of item attributes that can be retrieved for a single
operation is 100. Also, the number of items retrieved is constrained by a 1 MB
the size limit. If the response size limit is exceeded or a partial result is
returned due to an internal processing failure, Amazon DynamoDB returns an
Amazon DynamoDB automatically adjusts the number of items returned per page
to enforce this limit. For example, even if you ask to retrieve 100 items, but
each individual item is 50k in size, the system returns 20 items and an
appropriate
Examples
- Basic formatting example
$result = $client->batchGetItem(array( // RequestItems is required 'RequestItems' => array( // Associative array of custom 'TableName' key names 'TableName' => array( // Keys is required 'Keys' => array( array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), // ... repeated ), 'AttributesToGet' => array('string', ... ), 'ConsistentRead' => true || false, 'ProjectionExpression' => 'string', 'ExpressionAttributeNames' => array( // Associative array of custom 'ExpressionAttributeNameVariable' key names 'ExpressionAttributeNameVariable' => 'string', // ... repeated ), ), // ... repeated ), 'ReturnConsumedCapacity' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
RequestItems => (associative-array<associative-array>)Associative array of <TableName> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <TableName>.
A map of the table name and corresponding items to get by primary key. While requesting items, each table name can be invoked only once per operation.
-
<TableName> => (associative-array)-
Keys => (array<associative-array>)- (associative-array)
The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
- (associative-array)
-
AttributesToGet => (array<string>)List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
-
ConsistentRead => (bool)If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.
-
-
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Responses => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
Table names and the respective item attributes from the tables.
-
<string> => (associative-array)The item attributes from a response in a specific table, along with the read resources consumed on the table during the request.
-
Items => (array<associative-array>)- (associative-array<associative-array>)
Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
- (associative-array<associative-array>)
-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
-
-
-
UnprocessedKeys => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
Contains a map of tables and their respective keys that were not processed with the current response, possibly due to reaching a limit on the response size. The UnprocessedKeys value is in the same form as a RequestItems parameter (so the value can be provided directly to a subsequent BatchGetItem operation). For more information, see the above RequestItems parameter.
-
<string> => (associative-array)-
Keys => (array<associative-array>)- (associative-array)
The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
- (associative-array)
-
AttributesToGet => (array<string>)List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
-
ConsistentRead => (bool)If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.
-
-
Executes the BatchWriteItem operation.
Allows to execute a batch of Put and/or Delete Requests for many tables in a single call. A total of 25 requests are allowed.
There are no transaction guarantees provided by this API. It does not allow conditional puts nor does it support return values.
Examples
- Basic formatting example
$result = $client->batchWriteItem(array( // RequestItems is required 'RequestItems' => array( // Associative array of custom 'TableName' key names 'TableName' => array( array( 'PutRequest' => array( // Item is required 'Item' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ), 'DeleteRequest' => array( // Key is required 'Key' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ), ), // ... repeated ), // ... repeated ), 'ReturnConsumedCapacity' => 'string', 'ReturnItemCollectionMetrics' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
RequestItems => (associative-array<array<associative-array>>)Associative array of <TableName> keys mapping to (array<associative-array>) values. Each array key should be changed to an appropriate <TableName>.
A map of table name to list-of-write-requests. Used as input to the BatchWriteItem API call
-
<TableName> => (array<associative-array>)- (associative-array)
This structure is a Union of PutRequest and DeleteRequest. It can contain exactly one of PutRequest or DeleteRequest. Never Both. This is enforced in the code.
-
PutRequest => (associative-array)A container for a Put BatchWrite request
-
Item => (associative-array<associative-array>)Associative array of <AttributeName> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <AttributeName>.
The item to put
-
<AttributeName> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
-
DeleteRequest => (associative-array)A container for a Delete BatchWrite request
-
Key => (associative-array)The item's key to be delete
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
-
- (associative-array)
-
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Responses => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
The response object as a result of BatchWriteItem call. This is essentially a map of table name to ConsumedCapacityUnits.
-
<string> => (associative-array)-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
-
-
-
UnprocessedItems => (associative-array<array<associative-array>>)Associative array of <string> keys mapping to (array<associative-array>) values. Each array key should be changed to an appropriate <string>.
The Items which we could not successfully process in a BatchWriteItem call is returned as UnprocessedItems
-
<string> => (array<associative-array>)- (associative-array)
This structure is a Union of PutRequest and DeleteRequest. It can contain exactly one of PutRequest or DeleteRequest. Never Both. This is enforced in the code.
-
PutRequest => (associative-array)A container for a Put BatchWrite request
-
Item => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
The item to put
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
-
DeleteRequest => (associative-array)A container for a Delete BatchWrite request
-
Key => (associative-array)The item's key to be delete
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
-
- (associative-array)
-
Executes the CreateTable operation.
Adds a new table to your account.
The table name must be unique among those associated with the AWS Account
issuing the request, and the AWS Region that receives the request (e.g.
The
Examples
- Basic formatting example
$result = $client->createTable(array( // AttributeDefinitions is required 'AttributeDefinitions' => array( array( // AttributeName is required 'AttributeName' => 'string', // AttributeType is required 'AttributeType' => 'string', ), // ... repeated ), // TableName is required 'TableName' => 'string', // KeySchema is required 'KeySchema' => array( array( // AttributeName is required 'AttributeName' => 'string', // KeyType is required 'KeyType' => 'string', ), // ... repeated ), 'LocalSecondaryIndexes' => array( array( // IndexName is required 'IndexName' => 'string', // KeySchema is required 'KeySchema' => array( array( // AttributeName is required 'AttributeName' => 'string', // KeyType is required 'KeyType' => 'string', ), // ... repeated ), // Projection is required 'Projection' => array( 'ProjectionType' => 'string', 'NonKeyAttributes' => array('string', ... ), ), ), // ... repeated ), 'GlobalSecondaryIndexes' => array( array( // IndexName is required 'IndexName' => 'string', // KeySchema is required 'KeySchema' => array( array( // AttributeName is required 'AttributeName' => 'string', // KeyType is required 'KeyType' => 'string', ), // ... repeated ), // Projection is required 'Projection' => array( 'ProjectionType' => 'string', 'NonKeyAttributes' => array('string', ... ), ), // ProvisionedThroughput is required 'ProvisionedThroughput' => array( // ReadCapacityUnits is required 'ReadCapacityUnits' => integer, // WriteCapacityUnits is required 'WriteCapacityUnits' => integer, 'OnDemand' => true || false, ), ), // ... repeated ), // ProvisionedThroughput is required 'ProvisionedThroughput' => array( // ReadCapacityUnits is required 'ReadCapacityUnits' => integer, // WriteCapacityUnits is required 'WriteCapacityUnits' => integer, 'OnDemand' => true || false, ), 'StreamSpecification' => array( 'StreamEnabled' => true || false, 'StreamViewType' => 'string', ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table you want to create. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
KeySchema => (associative-array)The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string:S |N |B )The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string:S |N |B )The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
-
ProvisionedThroughput => (associative-array)Provisioned throughput reserves the required read and write resources for your table in terms of ReadCapacityUnits and WriteCapacityUnits. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads.
-
ReadCapacityUnits => (int)ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.
-
WriteCapacityUnits => (int)WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.
-
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
TableDescription => (associative-array)-
TableName => (string)The name of the table being described.
-
KeySchema => (associative-array)The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
-
TableStatus => (string) -
CreationDateTime => (string) -
ProvisionedThroughput => (associative-array)-
LastIncreaseDateTime => (string) -
LastDecreaseDateTime => (string) -
NumberOfDecreasesToday => (int) -
ReadCapacityUnits => (int) -
WriteCapacityUnits => (int)
-
-
TableSizeBytes => (int) -
ItemCount => (int)
-
Executes the DeleteItem operation.
Deletes a single item in a table by primary key.
You can perform a conditional delete operation that deletes the item if it exists, or if it has an expected attribute value.
Examples
- Basic formatting example
$result = $client->deleteItem(array( // TableName is required 'TableName' => 'string', // Key is required 'Key' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), 'Expected' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'Value' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), 'Exists' => true || false, 'ComparisonOperator' => 'string', 'AttributeValueList' => array( array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ), // ... repeated ), 'ConditionalOperator' => 'string', 'ReturnValues' => 'string', 'ReturnConsumedCapacity' => 'string', 'ReturnItemCollectionMetrics' => 'string', 'ConditionExpression' => 'string', 'ExpressionAttributeNames' => array( // Associative array of custom 'ExpressionAttributeNameVariable' key names 'ExpressionAttributeNameVariable' => 'string', // ... repeated ), 'ExpressionAttributeValues' => array( // Associative array of custom 'ExpressionAttributeValueVariable' key names 'ExpressionAttributeValueVariable' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table in which you want to delete an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
Key => (associative-array)The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
Expected => (associative-array<associative-array>)Associative array of <AttributeName> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <AttributeName>.
Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.
-
<AttributeName> => (associative-array)Allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it.
-
Value => (associative-array)Specify whether or not a value already exists and has a specific content for the attribute name-value pair.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
Exists => (bool)Specify whether or not a value already exists for the attribute name-value pair.
-
-
-
ReturnValues => (string:NONE |ALL_OLD |UPDATED_OLD |ALL_NEW |UPDATED_NEW )Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.
- NONE: Nothing is returned.
- ALL_OLD: Returns the attributes of the item as they were before the operation.
- UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
- ALL_NEW: Returns all the attributes and their new values after the operation.
- UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Attributes => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
If the ReturnValues parameter is provided as ALL_OLD in the request, Amazon DynamoDB returns an array of attribute name-value pairs (essentially, the deleted item). Otherwise, the response contains an empty set.
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
Executes the DeleteTable operation.
Deletes a table and all of its items.
If the table is in the
Examples
- Basic formatting example
$result = $client->deleteTable(array( // TableName is required 'TableName' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table you want to delete. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
TableDescription => (associative-array)-
TableName => (string)The name of the table being described.
-
KeySchema => (associative-array)The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
-
TableStatus => (string) -
CreationDateTime => (string) -
ProvisionedThroughput => (associative-array)-
LastIncreaseDateTime => (string) -
LastDecreaseDateTime => (string) -
NumberOfDecreasesToday => (int) -
ReadCapacityUnits => (int) -
WriteCapacityUnits => (int)
-
-
TableSizeBytes => (int) -
ItemCount => (int)
-
Executes the DescribeTable operation.
Retrieves information about the table, including the current status of the table, the primary key schema and when the table was created.
If the table does not exist, Amazon DynamoDB returns a
Examples
- Basic formatting example
$result = $client->describeTable(array( // TableName is required 'TableName' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table you want to describe. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Table => (associative-array)-
TableName => (string)The name of the table being described.
-
KeySchema => (associative-array)The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
-
TableStatus => (string) -
CreationDateTime => (string) -
ProvisionedThroughput => (associative-array)-
LastIncreaseDateTime => (string) -
LastDecreaseDateTime => (string) -
NumberOfDecreasesToday => (int) -
ReadCapacityUnits => (int) -
WriteCapacityUnits => (int)
-
-
TableSizeBytes => (int) -
ItemCount => (int)
-
Executes the GetItem operation.
Retrieves a set of Attributes for an item that matches the primary key.
The
Examples
- Basic formatting example
$result = $client->getItem(array( // TableName is required 'TableName' => 'string', // Key is required 'Key' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), 'AttributesToGet' => array('string', ... ), 'ConsistentRead' => true || false, 'ReturnConsumedCapacity' => 'string', 'ProjectionExpression' => 'string', 'ExpressionAttributeNames' => array( // Associative array of custom 'ExpressionAttributeNameVariable' key names 'ExpressionAttributeNameVariable' => 'string', // ... repeated ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
Key => (associative-array)The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
AttributesToGet => (array<string>)List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
-
ConsistentRead => (bool)If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Item => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
Contains the requested attributes.
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
Executes the ListTables operation.
Retrieves a paginated list of table names created by the AWS Account of the
caller in the AWS Region (e.g.
Examples
- Basic formatting example
$result = $client->listTables(array( 'ExclusiveStartTableName' => 'string', 'Limit' => integer, ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
ExclusiveStartTableName => (string)The name of the table that starts the list. If you already ran a ListTables operation and received a LastEvaluatedTableName value in the response, use that value here to continue the list.
-
Limit => (int)A number of maximum table names to return.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
TableNames => (array<string>) -
LastEvaluatedTableName => (string)The name of the last table in the current list. Use this value as the ExclusiveStartTableName in a new request to continue the list until all the table names are returned. If this value is null, all table names have been returned.
Executes the PutItem operation.
Creates a new item, or replaces an old item with a new item (including all the attributes).
If an item already exists in the specified table with the same primary key, the new item completely replaces the existing item. You can perform a conditional put (insert a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values.
Examples
- Basic formatting example
$result = $client->putItem(array( // TableName is required 'TableName' => 'string', // Item is required 'Item' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), 'Expected' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'Value' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), 'Exists' => true || false, 'ComparisonOperator' => 'string', 'AttributeValueList' => array( array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ), // ... repeated ), 'ReturnValues' => 'string', 'ReturnConsumedCapacity' => 'string', 'ReturnItemCollectionMetrics' => 'string', 'ConditionalOperator' => 'string', 'ConditionExpression' => 'string', 'ExpressionAttributeNames' => array( // Associative array of custom 'ExpressionAttributeNameVariable' key names 'ExpressionAttributeNameVariable' => 'string', // ... repeated ), 'ExpressionAttributeValues' => array( // Associative array of custom 'ExpressionAttributeValueVariable' key names 'ExpressionAttributeValueVariable' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table in which you want to put an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
Item => (associative-array<associative-array>)Associative array of <AttributeName> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <AttributeName>.
A map of the attributes for the item, and must include the primary key values that define the item. Other attribute name-value pairs can be provided for the item.
-
<AttributeName> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
Expected => (associative-array<associative-array>)Associative array of <AttributeName> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <AttributeName>.
Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.
-
<AttributeName> => (associative-array)Allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it.
-
Value => (associative-array)Specify whether or not a value already exists and has a specific content for the attribute name-value pair.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
Exists => (bool)Specify whether or not a value already exists for the attribute name-value pair.
-
-
-
ReturnValues => (string:NONE |ALL_OLD |UPDATED_OLD |ALL_NEW |UPDATED_NEW )Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.
- NONE: Nothing is returned.
- ALL_OLD: Returns the attributes of the item as they were before the operation.
- UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
- ALL_NEW: Returns all the attributes and their new values after the operation.
- UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Attributes => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
Attribute values before the put operation, but only if the ReturnValues parameter is specified as ALL_OLD in the request.
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
Executes the Query operation.
Gets the values of one or more items and its attributes by primary key (composite primary key, only).
Narrow the scope of the query using comparison operators on the
Examples
- Basic formatting example
$result = $client->query(array( // TableName is required 'TableName' => 'string', 'IndexName' => 'string', 'Select' => 'string', 'AttributesToGet' => array('string', ... ), 'Limit' => integer, 'ConsistentRead' => true || false, 'KeyConditions' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'AttributeValueList' => array( array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), // ComparisonOperator is required 'ComparisonOperator' => 'string', ), // ... repeated ), 'QueryFilter' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'AttributeValueList' => array( array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), // ComparisonOperator is required 'ComparisonOperator' => 'string', ), // ... repeated ), 'ConditionalOperator' => 'string', 'ScanIndexForward' => true || false, 'ExclusiveStartKey' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), 'ReturnConsumedCapacity' => 'string', 'ProjectionExpression' => 'string', 'FilterExpression' => 'string', 'KeyConditionExpression' => 'string', 'ExpressionAttributeNames' => array( // Associative array of custom 'ExpressionAttributeNameVariable' key names 'ExpressionAttributeNameVariable' => 'string', // ... repeated ), 'ExpressionAttributeValues' => array( // Associative array of custom 'ExpressionAttributeValueVariable' key names 'ExpressionAttributeValueVariable' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table in which you want to query. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
AttributesToGet => (array<string>)List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
-
Limit => (int)The maximum number of items to return. If Amazon DynamoDB hits this limit while querying the table, it stops the query and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the query. Also, if the result set size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the query and returns the matching values, and a LastEvaluatedKey to apply in a subsequent operation to continue the query.
-
ConsistentRead => (bool)If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.
-
Count => (bool)If set to true, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.
-
HashKeyValue => (associative-array)Attribute value of the hash component of the composite primary key.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyCondition => (associative-array)A container for the attribute values and comparison operators to use for the query.
-
AttributeValueList => (array<associative-array>)A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a BETWEEN comparison, the AttributeValueList contains two attribute values and the comparison operator.
- (associative-array)
AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
- (associative-array)
-
ComparisonOperator => (string:EQ |NE |IN |LE |LT |GE |GT |BETWEEN |NOT_NULL |NULL |CONTAINS |NOT_CONTAINS |BEGINS_WITH )A comparison operator is an enumeration of several operations:
- EQ for equal.
- NE for not equal.
- IN checks for exact matches.
- LE for less than or equal to.
- LT for less than.
- GE for greater than or equal to.
- GT for greater than.
- BETWEEN for between.
- NOT_NULL for exists.
- NULL for not exists.
- CONTAINS for substring or value in a set.
- NOT_CONTAINS for absence of a substring or absence of a value in a set.
- BEGINS_WITH for a substring prefix.
Scan operations support all available comparison operators.
Query operations support a subset of the available comparison operators: EQ, LE, LT, GE, GT, BETWEEN, and BEGINS_WITH.
-
-
ScanIndexForward => (bool)Specifies forward or backward traversal of the index. Amazon DynamoDB returns results reflecting the requested order, determined by the range key. The default value is true (forward).
-
ExclusiveStartKey => (associative-array)Primary key of the item from which to continue an earlier query. An earlier query might provide this value as the LastEvaluatedKey if that query operation was interrupted before completing the query; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new query request to continue the operation from that point.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Items => (array<associative-array>)- (associative-array<associative-array>)
Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
- (associative-array<associative-array>)
-
Count => (int)Number of items in the response.
-
LastEvaluatedKey => (associative-array)Primary key of the item where the query operation stopped, inclusive of the previous result set. Use this value to start a new operation excluding this value in the new request. The LastEvaluatedKey is null when the entire query result set is complete (i.e. the operation processed the "last page").
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
Executes the Scan operation.
Retrieves one or more items and its attributes by performing a full scan of a table.
Provide a
Examples
- Basic formatting example
$result = $client->scan(array( // TableName is required 'TableName' => 'string', 'IndexName' => 'string', 'AttributesToGet' => array('string', ... ), 'Limit' => integer, 'Select' => 'string', 'ScanFilter' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'AttributeValueList' => array( array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), // ComparisonOperator is required 'ComparisonOperator' => 'string', ), // ... repeated ), 'ConditionalOperator' => 'string', 'ExclusiveStartKey' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), 'ReturnConsumedCapacity' => 'string', 'TotalSegments' => integer, 'Segment' => integer, 'ProjectionExpression' => 'string', 'FilterExpression' => 'string', 'ExpressionAttributeNames' => array( // Associative array of custom 'ExpressionAttributeNameVariable' key names 'ExpressionAttributeNameVariable' => 'string', // ... repeated ), 'ExpressionAttributeValues' => array( // Associative array of custom 'ExpressionAttributeValueVariable' key names 'ExpressionAttributeValueVariable' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), 'ConsistentRead' => true || false, ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table in which you want to scan. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
AttributesToGet => (array<string>)List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
-
Limit => (int)The maximum number of items to return. If Amazon DynamoDB hits this limit while scanning the table, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan. Also, if the scanned data set size exceeds 1 MB before Amazon DynamoDB hits this limit, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan.
-
Count => (bool)If set to true, Amazon DynamoDB returns a total number of items for the Scan operation, even if the operation has no matching items for the assigned filter. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.
-
ScanFilter => (associative-array<associative-array>)Associative array of <String> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <String>.
Evaluates the scan results and returns only the desired values.
-
<String> => (associative-array)-
AttributeValueList => (array<associative-array>)A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a BETWEEN comparison, the AttributeValueList contains two attribute values and the comparison operator.
- (associative-array)
AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
- (associative-array)
-
ComparisonOperator => (string:EQ |NE |IN |LE |LT |GE |GT |BETWEEN |NOT_NULL |NULL |CONTAINS |NOT_CONTAINS |BEGINS_WITH )A comparison operator is an enumeration of several operations:
- EQ for equal.
- NE for not equal.
- IN checks for exact matches.
- LE for less than or equal to.
- LT for less than.
- GE for greater than or equal to.
- GT for greater than.
- BETWEEN for between.
- NOT_NULL for exists.
- NULL for not exists.
- CONTAINS for substring or value in a set.
- NOT_CONTAINS for absence of a substring or absence of a value in a set.
- BEGINS_WITH for a substring prefix.
Scan operations support all available comparison operators.
Query operations support a subset of the available comparison operators: EQ, LE, LT, GE, GT, BETWEEN, and BEGINS_WITH.
-
-
-
ExclusiveStartKey => (associative-array)Primary key of the item from which to continue an earlier scan. An earlier scan might provide this value if that scan operation was interrupted before scanning the entire table; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new scan request to continue the operation from that point.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Items => (array<associative-array>)- (associative-array<associative-array>)
Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
- (associative-array<associative-array>)
-
Count => (int)Number of items in the response.
-
ScannedCount => (int)Number of items in the complete scan before any filters are applied. A high ScannedCount value with few, or no, Count results indicates an inefficient Scan operation.
-
LastEvaluatedKey => (associative-array)Primary key of the item where the scan operation stopped. Provide this value in a subsequent scan operation to continue the operation from that point. The LastEvaluatedKey is null when the entire scan result set is complete (i.e. the operation processed the "last page").
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
Executes the UpdateItem operation.
Edits an existing item's attributes.
You can perform a conditional update (insert a new attribute name-value pair if it doesn't exist, or replace an existing name-value pair if it has certain expected attribute values).
Examples
- Basic formatting example
$result = $client->updateItem(array( // TableName is required 'TableName' => 'string', // Key is required 'Key' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), 'AttributeUpdates' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'Value' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), 'Action' => 'string', ), // ... repeated ), 'Expected' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( 'Value' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), 'Exists' => true || false, 'ComparisonOperator' => 'string', 'AttributeValueList' => array( array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ), // ... repeated ), 'ConditionalOperator' => 'string', 'ReturnValues' => 'string', 'ReturnConsumedCapacity' => 'string', 'ReturnItemCollectionMetrics' => 'string', 'UpdateExpression' => 'string', 'ConditionExpression' => 'string', 'ExpressionAttributeNames' => array( // Associative array of custom 'ExpressionAttributeNameVariable' key names 'ExpressionAttributeNameVariable' => 'string', // ... repeated ), 'ExpressionAttributeValues' => array( // Associative array of custom 'ExpressionAttributeValueVariable' key names 'ExpressionAttributeValueVariable' => array( 'S' => 'string', 'N' => 'string', 'B' => 'string', 'SS' => array('string', ... ), 'NS' => array('string', ... ), 'BS' => array('string', ... ), 'M' => array( // Associative array of custom 'AttributeName' key names 'AttributeName' => array( // Associative array of custom key value pairs ), // ... repeated ), 'L' => array( array( // Associative array of custom key value pairs ), // ... repeated ), 'NULL' => true || false, 'BOOL' => true || false, ), // ... repeated ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table in which you want to update an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
Key => (associative-array)The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
AttributeUpdates => (associative-array<associative-array>)Associative array of <AttributeName> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <AttributeName>.
Map of attribute name to the new value and action for the update. The attribute names specify the attributes to modify, and cannot contain any primary key attributes.
-
<AttributeName> => (associative-array)Specifies the attribute to update and how to perform the update. Possible values: PUT (default), ADD or DELETE.
-
Value => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
Action => (string:ADD |PUT |DELETE )The type of action for an item update operation. Only use the add action for numbers or sets; the specified value is added to the existing value. If a set of values is specified, the values are added to the existing set. Adds the specified attribute. If the attribute exists, it is replaced by the new value. If no value is specified, this removes the attribute and its value. If a set of values is specified, then the values in the specified set are removed from the old set.
-
-
-
Expected => (associative-array<associative-array>)Associative array of <AttributeName> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <AttributeName>.
Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.
-
<AttributeName> => (associative-array)Allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it.
-
Value => (associative-array)Specify whether or not a value already exists and has a specific content for the attribute name-value pair.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)The supplied string value will be automatically base64 encoded by the SDK. Base64 encoding this value before passing it into an operation will double-encode the data.
Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
Exists => (bool)Specify whether or not a value already exists for the attribute name-value pair.
-
-
-
ReturnValues => (string:NONE |ALL_OLD |UPDATED_OLD |ALL_NEW |UPDATED_NEW )Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.
- NONE: Nothing is returned.
- ALL_OLD: Returns the attributes of the item as they were before the operation.
- UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
- ALL_NEW: Returns all the attributes and their new values after the operation.
- UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Attributes => (associative-array<associative-array>)Associative array of <string> keys mapping to (associative-array) values. Each array key should be changed to an appropriate <string>.
A map of attribute name-value pairs, but only if the ReturnValues parameter is specified as something other than NONE in the request.
-
<string> => (associative-array)AttributeValue can be String, Number, Binary, StringSet, NumberSet, BinarySet.
-
S => (string)Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
-
N => (string)Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10−128 to 10+126.
-
B => (string)Binary attributes are sequences of unsigned bytes.
-
SS => (array<string>)A set of strings.
-
NS => (array<string>)A set of numbers.
-
BS => (array<string>)A set of binary attributes.
-
-
-
ConsumedCapacityUnits => (int)The number of Capacity Units of the provisioned throughput of the table consumed during the operation. GetItem, BatchGetItem, BatchWriteItem, Query, and Scan operations consume ReadCapacityUnits, while PutItem, UpdateItem, and DeleteItem operations consume WriteCapacityUnits.
Executes the UpdateTable operation.
Updates the provisioned throughput for the given table.
Setting the throughput for a table helps you manage performance and is part of the Provisioned Throughput feature of Amazon DynamoDB.
Examples
- Basic formatting example
$result = $client->updateTable(array( 'AttributeDefinitions' => array( array( // AttributeName is required 'AttributeName' => 'string', // AttributeType is required 'AttributeType' => 'string', ), // ... repeated ), // TableName is required 'TableName' => 'string', 'ProvisionedThroughput' => array( // ReadCapacityUnits is required 'ReadCapacityUnits' => integer, // WriteCapacityUnits is required 'WriteCapacityUnits' => integer, 'OnDemand' => true || false, ), 'GlobalSecondaryIndexUpdates' => array( array( 'Update' => array( // IndexName is required 'IndexName' => 'string', // ProvisionedThroughput is required 'ProvisionedThroughput' => array( // ReadCapacityUnits is required 'ReadCapacityUnits' => integer, // WriteCapacityUnits is required 'WriteCapacityUnits' => integer, 'OnDemand' => true || false, ), ), 'Create' => array( // IndexName is required 'IndexName' => 'string', // KeySchema is required 'KeySchema' => array( array( // AttributeName is required 'AttributeName' => 'string', // KeyType is required 'KeyType' => 'string', ), // ... repeated ), // Projection is required 'Projection' => array( 'ProjectionType' => 'string', 'NonKeyAttributes' => array('string', ... ), ), // ProvisionedThroughput is required 'ProvisionedThroughput' => array( // ReadCapacityUnits is required 'ReadCapacityUnits' => integer, // WriteCapacityUnits is required 'WriteCapacityUnits' => integer, 'OnDemand' => true || false, ), ), 'Delete' => array( // IndexName is required 'IndexName' => 'string', ), ), // ... repeated ), 'StreamSpecification' => array( 'StreamEnabled' => true || false, 'StreamViewType' => 'string', ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
TableName => (string)The name of the table you want to update. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
-
ProvisionedThroughput => (associative-array)Provisioned throughput reserves the required read and write resources for your table in terms of ReadCapacityUnits and WriteCapacityUnits. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads.
-
ReadCapacityUnits => (int)ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.
-
WriteCapacityUnits => (int)WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.
-
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
TableDescription => (associative-array)-
TableName => (string)The name of the table being described.
-
KeySchema => (associative-array)The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.
-
HashKeyElement => (associative-array)A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
RangeKeyElement => (associative-array)A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
-
AttributeName => (string)The AttributeName of the KeySchemaElement.
-
AttributeType => (string)The AttributeType of the KeySchemaElement which can be a String or a Number.
-
-
-
TableStatus => (string) -
CreationDateTime => (string) -
ProvisionedThroughput => (associative-array)-
LastIncreaseDateTime => (string) -
LastDecreaseDateTime => (string) -
NumberOfDecreasesToday => (int) -
ReadCapacityUnits => (int) -
WriteCapacityUnits => (int)
-
-
TableSizeBytes => (int) -
ItemCount => (int)
-
Wait until a table exists and can be accessed The input array uses the parameters of the DescribeTable operation and waiter specific settings
Parameters
- $input
array
$input
Wait until a table is deleted The input array uses the parameters of the DescribeTable operation and waiter specific settings
Parameters
- $input
array
$input
The input array uses the parameters of the BatchGetItem operation
Parameters
- $args
array
$args
Returns
ResourceIteratorInterface
The input array uses the parameters of the ListTables operation
Parameters
- $args
array
$args
Returns
ResourceIteratorInterface
The input array uses the parameters of the Query operation
Parameters
- $args
array
$args
Returns
ResourceIteratorInterface
The input array uses the parameters of the Scan operation
Parameters
- $args
array
$args
Returns
ResourceIteratorInterface
Methods inherited from Aws\Common\Client\AbstractClient
__call()
,
__construct()
,
createRequest()
,
getAllEvents()
,
getApiVersion()
,
getCredentials()
,
getRegion()
,
getRegions()
,
getSignature()
,
getWaiter()
,
getWaiterFactory()
,
send()
,
setCredentials()
,
setRegion()
,
setWaiterFactory()
,
waitUntil()
Methods inherited from Guzzle\Service\Client
execute()
,
executeMultiple()
,
getCommand()
,
getCommandFactory()
,
getDescription()
,
getInflector()
,
getIterator()
,
getResourceIteratorFactory()
,
prepareCommand()
,
setCommandFactory()
,
setDescription()
,
setInflector()
,
setResourceIteratorFactory()
Methods inherited from Guzzle\Http\Client
delete()
,
expandTemplate()
,
extractPharCacert()
,
get()
,
getBaseUrl()
,
getConfig()
,
getCurlMulti()
,
getDefaultOption()
,
getDefaultUserAgent()
,
getUriTemplate()
,
head()
,
initSsl()
,
options()
,
patch()
,
post()
,
prepareRequest()
,
put()
,
sendMultiple()
,
setBaseUrl()
,
setConfig()
,
setCurlMulti()
,
setDefaultOption()
,
setRequestFactory()
,
setSslVerification()
,
setUriTemplate()
,
setUserAgent()
Methods inherited from Guzzle\Common\AbstractHasDispatcher
addSubscriber()
,
dispatch()
,
getEventDispatcher()
,
setEventDispatcher()
Magic methods summary
Constants summary
string |
LATEST_API_VERSION |
'2011-12-05' |
Constants inherited from Guzzle\Service\Client
Constants inherited from Guzzle\Http\Client
CURL_OPTIONS
,
DEFAULT_SELECT_TIMEOUT
,
DISABLE_REDIRECTS
,
MAX_HANDLES
,
REQUEST_OPTIONS
,
SSL_CERT_AUTHORITY
Constants inherited from Guzzle\Http\ClientInterface
Properties summary
Properties inherited from Aws\Common\Client\AbstractClient
$aggregator
,
$credentials
,
$signature
,
$waiterFactory
Properties inherited from Guzzle\Service\Client
$commandFactory
,
$inflector
,
$resourceIteratorFactory
,
$serviceDescription
Properties inherited from Guzzle\Http\Client
$defaultHeaders
,
$requestFactory
,
$userAgent