$response = array(
"TableName" => "tableName",
"AttributesToGet" => array('user_id'),
"ConditionalOperator" => 'AND',
"IndexName" => "indexname",
"KeyConditions" => array(
// Global Secondary HASH Key
'id' => array(
"ComparisonOperator" => 'EQ',
"AttributeValueList" => array(
array('S' => (string)$id)
)
),
// Global Secondary Range Key
'date' => array(
"ComparisonOperator" => 'EQ',
"AttributeValueList" => array(
array('S' => (string)$date)
)
),
),
'QueryFilter' => array(
// no index
'status' => array(
'ComparisonOperator' => 'EQ',
'AttributeValueList' => array(
array( 'S' => (string)"0")
)
)
),
);
$result = $client->query($response);
var_dump($result);
然后回复:
array(2) { [0]=> array(2) {
["status"]=> array(1) { ["S"]=> string(1) "1" }
["user_id"]=> array(1) { ["S"]=> string(17) "20140425153549703" } }
[1]=> array(2) {
["status"]=> array(1) { ["S"]=> string(1) "0" }
["user_id"]=> array(1) { ["S"]=> string(17) "20140421162848857" } }
}
但我只希望" status" = 0,
我已经在状态条件中使用了QueryFilter但是没有工作......