Database Reference
In-Depth Information
Query
The following code will perform the query operation on index items with
PubDate
between
2009-12-28
and
2012-07-28
and
BookTitle
as
SCJP
.
{
"TableName": "Tbl_Book",
"IndexName": "Idx_PubDate",
"Select": "ALL_ATTRIBUTES",
"Limit":30,
"ConsistentRead": true,
"KeyConditions": {
"PubDate": {
"AttributeValueList": [{"S": "2009-12-28"},{"S":
"2012-07-28"}],
"ComparisonOperator": "BETWEEN" },
"BookTitle": {
"AttributeValueList": [{"S": "SCJP"}],
"ComparisonOperator": "EQ"}},
"ReturnConsumedCapacity": "TOTAL"
}
Even though we have specified the item limit of the query as 30, there are only two items
that satisfy these conditions. So, it returns those items, as shown in the following code:
{
"Count": 2,
"Items": [
{
"BookTitle": {"S": "SCJP"}, "Author": {"S": "Kathy"},
"Publisher": {"S": "TMH"},"PubDate": {"S":
"2009-12-28"},
"Language": {"SS": ["English", "German"]}, "Edition":
{"N": "1"}},
{
"BookTitle": {"S": "SCJP"}, "Author": {"S": "Khalid A
M"},
"PubDate": {"S": "2010-10-28"},"Language": {"SS":