class Aws::DynamoDB::Types::QueryInput
@see docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/QueryInput AWS API Documentation
@return [Hash<String,Types::AttributeValue>]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html<br><br><br><br>Conditions][1] in the *Amazon DynamoDB Developer Guide*.
For more information on expression attribute values, see [Specifying
`ProductStatus IN (:avail, :back, :disc)‘
You could then use these values in an expression, such as this:
“:disc”:{“S”:“Discontinued”} }`
`{ “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”},
follows:
You would first need to specify `ExpressionAttributeValues` as
`Available | Backordered | Discontinued`
following:
whether the value of the ProductStatus attribute was one of the
attribute value. For example, suppose that you wanted to check
Use the : (colon) character in an expression to dereference an
One or more values that can be substituted in an expression.
@!attribute [rw] expression_attribute_values
@return [Hash<String,String>]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html<br>[1]: docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html<br><br><br><br>Item Attributes] in the *Amazon DynamoDB Developer Guide*.
For more information on expression attribute names, see [Specifying
</note>
runtime.
attribute values*, which are placeholders for the actual value at
<note markdown=“1”> Tokens that begin with the : character are *expression
^
* `#P = :val`
example:
You could then use this substitution in an expression, as in this
^
* `{“#P”:“Percentile”}`
following for `ExpressionAttributeNames`:
Developer Guide*). To work around this, you could specify the
reserved words, see [Reserved Words] in the *Amazon DynamoDB
cannot be used directly in an expression. (For the complete list of
The name of this attribute conflicts with a reserved word, so it
^
* `Percentile`
name. For example, consider the following attribute name:
Use the **#** character in an expression to dereference an attribute
misinterpreted in an expression.
* To prevent special characters in an attribute name from being
name in an expression.
* To create a placeholder for repeating occurrences of an attribute
reserved word.
* To access an attribute whose name conflicts with a DynamoDB
`ExpressionAttributeNames`:
expression. The following are some use cases for using
One or more substitution tokens for attribute names in an
@!attribute [rw] expression_attribute_names
@return [String]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html<br>[1]: docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html<br><br><br><br>Names and Values] in the *Amazon DynamoDB Developer Guide*.
`ExpressionAttributeValues`, see [Using Placeholders for Attribute
For more information on `ExpressionAttributeNames` and
DynamoDB Developer Guide*.
For a list of reserved words, see [Reserved Words] in the *Amazon
^
* `#S = :myval`
follows:
the attribute name Size. `KeyConditionExpression` then is as
To work around this, define a placeholder (such a `#S`) to represent
^
* `Size = :myval`
a reserved word:
`KeyConditionExpression` parameter causes an error because Size is
conflicts with a DynamoDB reserved word. For example, the following
tokens. This option might be necessary if an attribute name
replace the names of the partition key and sort key with placeholder
You can optionally use the `ExpressionAttributeNames` parameter to
as `:partitionval` and `:sortval` with actual values at runtime.
Use the `ExpressionAttributeValues` parameter to replace tokens such
the function name `begins_with` is case-sensitive.
this function with a sort key that is of type Number.) Note that
sort key value begins with a particular operand. (You cannot use
* `begins_with (` `sortKeyName`, `:sortkeyval` `)` - true if the
and less than or equal to `:sortkeyval2`.
if the sort key value is greater than or equal to `:sortkeyval1`,
* `sortKeyName` `BETWEEN` `:sortkeyval1` `AND` `:sortkeyval2` - true
greater than or equal to `:sortkeyval`.
* `sortKeyName` `>= ` `:sortkeyval` - true if the sort key value is
greater than `:sortkeyval`.
* `sortKeyName` `>` `:sortkeyval` - true if the sort key value is
less than or equal to `:sortkeyval`.
* `sortKeyName` `<=` `:sortkeyval` - true if the sort key value is
less than `:sortkeyval`.
* `sortKeyName` `<` `:sortkeyval` - true if the sort key value is
equal to `:sortkeyval`.
* `sortKeyName` `=` `:sortkeyval` - true if the sort key value is
Valid comparisons for the sort key condition are as follows:
`:sortkeyval`
`partitionKeyName` `=` `:partitionkeyval` `AND` `sortKeyName` `=`
is an example, using the **=** comparison operator for the sort key:
combined using `AND` with the condition for the sort key. Following
If you also want to provide a condition for the sort key, it must be
`partitionKeyName` *=* `:partitionkeyval`
in the following format:
The partition key equality test is required, and must be specified
values.
items that have the same partition key value but different sort key
with a given partition key value and sort key value, or several
on a single sort key value. This allows `Query` to retrieve one item
The condition can optionally perform one of several comparison tests
key value.
The condition must perform an equality test on a single partition
retrieved by the `Query` action.
The condition that specifies the key values for items to be
@!attribute [rw] key_condition_expression
@return [String]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html<br><br><br><br>DynamoDB Developer Guide*.
For more information, see [Filter Expressions] in the *Amazon
</note>
capacity units.
read; the process of filtering does not consume any additional read
<note markdown=“1”> A `FilterExpression` is applied after the items have already been
define a filter expression based on a partition key or a sort key.
A `FilterExpression` does not allow key attributes. You cannot
returned.
that do not satisfy the `FilterExpression` criteria are not
`Query` operation, but before the data is returned to you. Items
A string that contains conditions that DynamoDB applies after the
@!attribute [rw] filter_expression
@return [String]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html<br><br><br><br>*Amazon DynamoDB Developer Guide*.
For more information, see [Accessing Item Attributes] in the
will not appear in the result.
returned. If any of the requested attributes are not found, they
If no attribute names are specified, then all attributes will be
commas.
JSON document. The attributes in the expression must be separated by
table. These attributes can include scalars, sets, or elements of a
A string that identifies one or more attributes to retrieve from the
@!attribute [rw] projection_expression
@return [String]
response.
* `NONE` - No `ConsumedCapacity` details are included in the
`ConsumedCapacity` for the operation.
* `TOTAL` - The response includes only the aggregate
table(s).
`INDEXES` will only return `ConsumedCapacity` information for
do not access any indexes at all. In these cases, specifying
Note that some operations, such as `GetItem` and `BatchGetItem`,
and secondary index that was accessed.
for the operation, together with `ConsumedCapacity` for each table
* `INDEXES` - The response includes the aggregate `ConsumedCapacity`
throughput consumption that is returned in the response:
Determines the level of detail about either provisioned or on-demand
@!attribute [rw] return_consumed_capacity
@return [Hash<String,Types::AttributeValue>]
Binary. No set data types are allowed.
The data type for `ExclusiveStartKey` must be String, Number, or
previous operation.
Use the value that was returned for `LastEvaluatedKey` in the
The primary key of the first item that this operation will evaluate.
@!attribute [rw] exclusive_start_key
@return [Boolean]
results to the client.
the results in reverse order by sort key value, and then returns the
default behavior. If `ScanIndexForward` is `false`, DynamoDB reads
order in which they are stored (by sort key value). This is the
If `ScanIndexForward` is `true`, DynamoDB returns the results in the
the binary data as unsigned.
order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of
stored in numeric order. For type String, the results are stored in
by sort key. If the sort key data type is Number, the results are
Items with the same partition key value are stored in sorted order
is performed in descending order.
traversal is performed in ascending order; if `false`, the traversal
Specifies the order for index traversal: If `true` (default), the
@!attribute [rw] scan_index_forward
@return [String]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html<br><br><br><br>Developer Guide*.
information, see [ConditionalOperator] in the *Amazon DynamoDB
This is a legacy parameter. Use `FilterExpression` instead. For more
@!attribute [rw] conditional_operator
@return [Hash<String,Types::Condition>]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html<br><br><br><br>Guide*.
information, see [QueryFilter] in the *Amazon DynamoDB Developer
This is a legacy parameter. Use `FilterExpression` instead. For more
@!attribute [rw] query_filter
@return [Hash<String,Types::Condition>]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html<br><br><br><br>Developer Guide*.
For more information, see [KeyConditions] in the *Amazon DynamoDB
This is a legacy parameter. Use `KeyConditionExpression` instead.
@!attribute [rw] key_conditions
@return [Boolean]
set to `true`, you will receive a `ValidationException`.
indexes. If you query a global secondary index with `ConsistentRead`
Strongly consistent reads are not supported on global secondary
uses eventually consistent reads.
operation uses strongly consistent reads; otherwise, the operation
Determines the read consistency model: If set to `true`, then the
@!attribute [rw] consistent_read
@return [Integer]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html<br><br><br><br>*Amazon DynamoDB Developer Guide*.
the operation. For more information, see [Query and Scan] in the
in `LastEvaluatedKey` to apply in a subsequent operation to continue
operation and returns the matching values up to the limit, and a key
exceeds 1 MB before DynamoDB reaches this limit, it stops the
can pick up where you left off. Also, if the processed dataset size
`LastEvaluatedKey` to apply in a subsequent operation, so that you
returns the matching values up to that point, and a key in
the limit while processing the results, it stops the operation and
of matching items). If DynamoDB processes the number of items up to
The maximum number of items to evaluate (not necessarily the number
@!attribute [rw] limit
@return [Array<String>]<br>: docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html<br><br><br><br>Developer Guide*.
more information, see [AttributesToGet] in the *Amazon DynamoDB
This is a legacy parameter. Use `ProjectionExpression` instead. For
@!attribute [rw] attributes_to_get
@return [String]
</note>
`Select` will return an error.
`Select` can only be `SPECIFIC_ATTRIBUTES`. Any other value for
<note markdown=“1”> If you use the `ProjectionExpression` parameter, then the value for
without any value for `Select`.)
(This usage is equivalent to specifying `ProjectionExpression`
request, unless the value for `Select` is `SPECIFIC_ATTRIBUTES`.
both `Select` and `ProjectionExpression` together in a single
`ALL_PROJECTED_ATTRIBUTES` when accessing an index. You cannot use
DynamoDB defaults to `ALL_ATTRIBUTES` when accessing a table, and
If neither `Select` nor `ProjectionExpression` are specified,
table.
secondary index queries cannot fetch attributes from the parent
request attributes that are projected into the index. Global
If you query or scan a global secondary index, you can only
This extra fetching incurs additional throughput cost and latency.
DynamoDB fetches each of these attributes from the parent table.
attributes are not projected into the local secondary index,
read only the index and not the table. If any of the requested
attributes that are projected into that index, the operation will
If you query or scan a local secondary index and request only
`Select`.
specifying `ProjectionExpression` without specifying any value for
`ProjectionExpression`. This return value is equivalent to
* `SPECIFIC_ATTRIBUTES` - Returns only the attributes listed in
same item size calculations.
of read capacity units as getting the items, and is subject to the
matching items themselves. Note that this uses the same quantity
* `COUNT` - Returns the number of matching items, rather than the
value is equivalent to specifying `ALL_ATTRIBUTES`.
If the index is configured to project all attributes, this return
Retrieves all attributes that have been projected into the index.
* `ALL_PROJECTED_ATTRIBUTES` - Allowed only when querying an index.
from the local secondary index, and no fetching is required.
project all item attributes, then all of the data can be obtained
entire item from the parent table. If the index is configured to
then for each matching item in the index, DynamoDB fetches the
specified table or index. If you query a local secondary index,
* `ALL_ATTRIBUTES` - Returns all of the item attributes from the
projected into the index.
items, or in the case of an index, some or all of the attributes
item attributes, specific item attributes, the count of matching
The attributes to be returned in the result. You can retrieve all
@!attribute [rw] select
@return [String]
the `IndexName` parameter, you must also provide `TableName.`
index or global secondary index on the table. Note that if you use
The name of an index to query. This index can be any local secondary
@!attribute [rw] index_name
@return [String]
parameter.
provide the Amazon Resource Name (ARN) of the table in this
The name of the table containing the requested items. You can also
@!attribute [rw] table_name
Represents the input of a `Query` operation.