Query

POST v1/data/{project_id}/tables/{table_name}/query

Request Syntax

{
    "attributes_to_get": [
        "string"
    ],
    "consistent_read": "boolean",
    "exclusive_start_key": {
        "string": {
            "B": "blob",
            "BS": [
                "blob"
            ],
            "N": "string",
            "NS": [
                "string"
            ],
            "S": "string",
            "SS": [
                "string"
            ]
        }
    },
    "index_name": "string",
    "key_conditions": {
        "string": {
            "attribute_value_list": [
                {
                    "B": "blob",
                    "BS": [
                        "blob"
                    ],
                    "N": "string",
                    "NS": [
                        "string"
                    ],
                    "S": "string",
                    "SS": [
                        "string"
                    ]
                }
            ],
            "comparison_operator": "string"
        }
    },
    "limit": "number",
    "scan_index_forward": "boolean",
    "select": "string"
}

Request Parameters

attributes_to_get
Type: array of Strings
Required: No
consistent_read
Type: Boolean
Required: No
exclusive_start_key
The primary key of the first item that this operation will evaluate.
Type: String to object map
Required: No
index_name
The name of an index to query.
Type: String
Required: No
key_conditions
The selection criteria for the query.
Type: String to Condition object map
Required: Yes
limit
Type: Number
Required: No
scan_index_forward
Type: Boolean
Required: No
select
The attributes to be returned in the result.
Type: String
Valid values: ALL_ATTRIBUTES | ALL_PROJECTED_ATTRIBUTES | SPECIFIC_ATTRIBUTES | COUNT
Required: No

Response Syntax

{
    "count": "number",
    "items": [

        {
            "string": {
                "B": "blob",
                "BS": [
                    "blob"
                ],
                "N": "string",
                "NS": [
                    "string"
                ],
                "S": "string",
                "SS": [
                    "string"
                ]
            }
        }
    ],
    "last_evaluated_key": {
        "string": {
            "B": "blob",
            "BS": [
                "blob"
            ],
            "N": "string",
            "NS": [
                "string"
            ],
            "S": "string",
            "SS": [
                "string"
            ]
        }
    }
}

Response Elements

count
The number of items in the response.
Type: Number
items
An array of items.
Type: array of items
last_evaluated_key
The primary key of the item where the operation stopped.
Type: String to AttributeValue object map

Errors

BackendInteractionException
ClusterIsNotConnectedException
ValidationError

Sample Request

{
    "attributes_to_get": [
        "ForumName", "LastPostDateTime", "Posts"
    ],
    "exclusive_start_key": {
        "ForumName": {
            "S": "Testing OS API"
        },
        "LastPostDayTime": {
            "S": "3/1/14"
        }
    },
    "index_name": "LastPostIndex",
    "limit": 2,
    "consistent_read": true,
    "scan_index_forward": true,
    "key_conditions": {
        "ForumName": {
            "attribute_value_list": [
                {
                    "S": "Testing OS API"
                }
            ],
            "comparison_operator": "EQ"
        },
        "LastPostDateTime": {
            "attribute_value_list": [
                {
                    "S": "3/10/14"
                }
            ],
            "comparison_operator": "GT"
        }
    },
    "select": "SPECIFIC_ATTRIBUTES"
}

Sample Response

{
    "count": 2,
    "items": [
        {
            "ForumName": {
                "S": "Testing OS API"
            },
            "LastPostDateTime": {
                "S": "3/18/14"
            },
            "Posts": {
                "SS": ["Opening post"]
            }
        },
        {
            "ForumName": {
                "S": "Testing OS API"
            },
            "LastPostDateTime": {
                "S": "3/19/14"
            },
            "Posts": {
                "SS": ["Hello", "Hi"]
            }
        }
    ],
    "last_evaluated_key": {
        "ForumName": {
            "S": "Testing OS API"
        },
        "LastPostDateTime": {
            "S": "3/19/14"
        }
    }
}