QueryFilter在dynamodb中的查询操作内部不起作用


$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" } } 
         } 

但我只想"状态"=0,

我已经在状态条件中使用了QueryFilter,但不起作用。。。

我遇到了同样的问题,Harshal Bulsara帮助了我。转到下载AWS SDK for PHP并更新您的SDK。为我工作!

相关内容

  • 没有找到相关文章

最新更新