SimpleDB / Client / select

select#

SimpleDB.Client.select(**kwargs)#

The Select operation returns a set of attributes for ItemNames that match the select expression. Select is similar to the standard SQL SELECT statement.

The total size of the response cannot exceed 1 MB in total size. Amazon SimpleDB automatically adjusts the number of items returned per page to enforce this limit. For example, if the client asks to retrieve 2500 items, but each individual item is 10 kB in size, the system returns 100 items and an appropriate NextToken so the client can access the next page of results.

For information on how to construct select expressions, see Using Select to Create Amazon SimpleDB Queries in the Developer Guide.

See also: AWS API Documentation

Request Syntax

response = client.select(
    SelectExpression='string',
    NextToken='string',
    ConsistentRead=True|False
)
Parameters:
  • SelectExpression (string) – [REQUIRED] The expression used to query the domain.

  • NextToken (string) – A string informing Amazon SimpleDB where to start the next list of ItemNames.

  • ConsistentRead (boolean) – Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.

Return type:

dict

Returns:

Response Syntax

{
    'Items': [
        {
            'Name': 'string',
            'AlternateNameEncoding': 'string',
            'Attributes': [
                {
                    'Name': 'string',
                    'AlternateNameEncoding': 'string',
                    'Value': 'string',
                    'AlternateValueEncoding': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Items (list) – A list of items that match the select expression.

      • (dict) –

        • Name (string) – The name of the item.

        • AlternateNameEncoding (string) –

        • Attributes (list) – A list of attributes.

          • (dict) –

            • Name (string) – The name of the attribute.

            • AlternateNameEncoding (string) –

            • Value (string) – The value of the attribute.

            • AlternateValueEncoding (string) –

    • NextToken (string) – An opaque token indicating that more items than MaxNumberOfItems were matched, the response size exceeded 1 megabyte, or the execution time exceeded 5 seconds.

Exceptions

  • SimpleDB.Client.exceptions.InvalidParameterValue

  • SimpleDB.Client.exceptions.InvalidNextToken

  • SimpleDB.Client.exceptions.InvalidNumberPredicates

  • SimpleDB.Client.exceptions.InvalidNumberValueTests

  • SimpleDB.Client.exceptions.InvalidQueryExpression

  • SimpleDB.Client.exceptions.MissingParameter

  • SimpleDB.Client.exceptions.NoSuchDomain

  • SimpleDB.Client.exceptions.RequestTimeout

  • SimpleDB.Client.exceptions.TooManyRequestedAttributes