Dynamodb-Abfrage-Fehler - Abfrage-key-Zustand, nicht unterstützt

Ich versuche Abfrage meiner dynamodb-Tabelle, um feed_guid und status_id = 1. Aber es gibt Abfrage-key-Bedingung wird nicht unterstützt Fehler.
Finden Sie mein schema für die Tabelle und Abfrage.

$result =$dynamodbClient->createTable(array(
            'TableName' => 'feed',
            'AttributeDefinitions' => array(
                array('AttributeName' => 'user_id', 'AttributeType' => 'S'),
                array('AttributeName' => 'feed_guid',    'AttributeType' => 'S'),
                array('AttributeName' => 'status_id',  'AttributeType' => 'N'),
            ),
            'KeySchema' => array(
                array('AttributeName' => 'feed_guid', 'KeyType' => 'HASH'),
            ),

            'GlobalSecondaryIndexes' => array(
                array(
                    'IndexName' => 'StatusIndex',
                    'ProvisionedThroughput' => array (
                        'ReadCapacityUnits' => 5,
                        'WriteCapacityUnits' => 5
                    ),
                    'KeySchema' => array(
                        array(
                            'AttributeName' => 'status_id',
                            'KeyType' => 'HASH'
                        ),
                    ),
                    'Projection' => array(
                        'ProjectionType' => 'ALL'
                    )
                ),

                array(
                    'IndexName' => 'UserIdIndex',
                    'ProvisionedThroughput' => array (
                        'ReadCapacityUnits' => 5,
                        'WriteCapacityUnits' => 5
                    ),
                    'KeySchema' => array(
                        array(
                            'AttributeName' => 'user_id',
                            'KeyType' => 'HASH'
                        ),
                    ),
                    'Projection' => array(
                        'ProjectionType' => 'ALL'
                    )
                )

            ),
            'ProvisionedThroughput' => array(
                'ReadCapacityUnits'  => 10,
                'WriteCapacityUnits' => 20
            )
        ));

Folgende ist meine Abfrage zu aktualisieren, die Tabelle.

 $result = $dynamodbClient->query(array(
            'TableName' => 'feed',
            'KeyConditionExpression' => 'feed_guid = :v_fid AND status_id = :v_sid ',
            'ExpressionAttributeValues' =>  array(
                ':v_fid' => array('S' => '71a27f0547cd5456d9ee7c181b6cb2f8'),
                ':v_sid' => array('N' => 1)
            ),
            'ConsistentRead' => false
        ));
  • Sie haben nicht zu definieren, status_id, als Bereich zum ausführen dieser Abfrage
  • So können wir nicht Benutzer sekundäre Indizes nur?
InformationsquelleAutor Arun SS | 2015-08-05
Schreibe einen Kommentar