404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.225.254.112: ~ $
**Example 1: To query a table**

The following ``query`` example queries items in the ``MusicCollection`` table. The table has a hash-and-range primary key (``Artist`` and ``SongTitle``), but this query only specifies the hash key value. It returns song titles by the artist named "No One You Know". ::

    aws dynamodb query \
        --table-name MusicCollection \
        --projection-expression "SongTitle" \
        --key-condition-expression "Artist = :v1" \
        --expression-attribute-values file://expression-attributes.json \
        --return-consumed-capacity TOTAL

Contents of ``expression-attributes.json``::

    {
        ":v1": {"S": "No One You Know"}
    }

Output::

    {
        "Items": [
            {
                "SongTitle": {
                    "S": "Call Me Today"
                },
                "SongTitle": {
                    "S": "Scared of My Shadow"
                }
            }
        ],
        "Count": 2,
        "ScannedCount": 2,
        "ConsumedCapacity": {
            "TableName": "MusicCollection",
            "CapacityUnits": 0.5
        }
    }

For more information, see `Working with Queries in DynamoDB <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html>`__ in the *Amazon DynamoDB Developer Guide*.

**Example 2: To query a table using strongly consistent reads and traverse the index in descending order**

The following example performs the same query as the first example, but returns results in reverse order and uses strongly consistent reads. ::

    aws dynamodb query \
        --table-name MusicCollection \
        --projection-expression "SongTitle" \
        --key-condition-expression "Artist = :v1" \
        --expression-attribute-values file://expression-attributes.json \
        --consistent-read \
        --no-scan-index-forward \
        --return-consumed-capacity TOTAL

Contents of ``expression-attributes.json``::

    {
        ":v1": {"S": "No One You Know"}
    }

Output::

    {
        "Items": [
            {
                "SongTitle": {
                    "S": "Scared of My Shadow"
                }
            },
            {
                "SongTitle": {
                    "S": "Call Me Today"
                }
            }
        ],
        "Count": 2,
        "ScannedCount": 2,
        "ConsumedCapacity": {
            "TableName": "MusicCollection",
            "CapacityUnits": 1.0
        }
    }

For more information, see `Working with Queries in DynamoDB <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html>`__ in the *Amazon DynamoDB Developer Guide*.

**Example 3: To filter out specific results**

The following example queries the ``MusicCollection`` but excludes results with specific values in the ``AlbumTitle`` attribute. Note that this does not affect the ``ScannedCount`` or ``ConsumedCapacity``, because the filter is applied after the items have been read. ::

    aws dynamodb query \
        --table-name MusicCollection \
        --key-condition-expression "#n1 = :v1" \
        --filter-expression "NOT (#n2 IN (:v2, :v3))" \
        --expression-attribute-names file://names.json \
        --expression-attribute-values file://values.json \
        --return-consumed-capacity TOTAL

Contents of ``values.json``::

    {
        ":v1": {"S": "No One You Know"},
        ":v2": {"S": "Blue Sky Blues"},
        ":v3": {"S": "Greatest Hits"}
    }

Contents of ``names.json``::

    {
        "#n1": "Artist",
        "#n2": "AlbumTitle"
    }

Output::

    {
        "Items": [
            {
                "AlbumTitle": {
                    "S": "Somewhat Famous"
                },
                "Artist": {
                    "S": "No One You Know"
                },
                "SongTitle": {
                    "S": "Call Me Today"
                }
            }
        ],
        "Count": 1,
        "ScannedCount": 2,
        "ConsumedCapacity": {
            "TableName": "MusicCollection",
            "CapacityUnits": 0.5
        }
    }

For more information, see `Working with Queries in DynamoDB <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html>`__ in the *Amazon DynamoDB Developer Guide*.

**Example 4: To retrieve only an item count**

The following example retrieves a count of items matching the query, but does not retrieve any of the items themselves. ::

    aws dynamodb query \
        --table-name MusicCollection \
        --select COUNT \
        --key-condition-expression "Artist = :v1" \
        --expression-attribute-values file://expression-attributes.json

Contents of ``expression-attributes.json``::

    {
        ":v1": {"S": "No One You Know"}
    }

Output::

    {
        "Count": 2,
        "ScannedCount": 2,
        "ConsumedCapacity": null
    }

For more information, see `Working with Queries in DynamoDB <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html>`__ in the *Amazon DynamoDB Developer Guide*.

**Example 5: To query an index**

The following example queries the local secondary index ``AlbumTitleIndex``. The query returns all attributes from the base table that have been projected into the local secondary index. Note that when querying a local secondary index or global secondary index, you must also provide the name of the base table using the ``table-name`` parameter. ::

    aws dynamodb query \
        --table-name MusicCollection \
        --index-name AlbumTitleIndex \
        --key-condition-expression "Artist = :v1" \
        --expression-attribute-values file://expression-attributes.json \
        --select ALL_PROJECTED_ATTRIBUTES \
        --return-consumed-capacity INDEXES

Contents of ``expression-attributes.json``::

    {
        ":v1": {"S": "No One You Know"}
    }

Output::

    {
        "Items": [
            {
                "AlbumTitle": {
                    "S": "Blue Sky Blues"
                },
                "Artist": {
                    "S": "No One You Know"
                },
                "SongTitle": {
                    "S": "Scared of My Shadow"
                }
            },
            {
                "AlbumTitle": {
                    "S": "Somewhat Famous"
                },
                "Artist": {
                    "S": "No One You Know"
                },
                "SongTitle": {
                    "S": "Call Me Today"
                }
            }
        ],
        "Count": 2,
        "ScannedCount": 2,
        "ConsumedCapacity": {
            "TableName": "MusicCollection",
            "CapacityUnits": 0.5,
            "Table": {
                "CapacityUnits": 0.0
            },
            "LocalSecondaryIndexes": {
                "AlbumTitleIndex": {
                    "CapacityUnits": 0.5
                }
            }
        }
    }

For more information, see `Working with Queries in DynamoDB <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html>`__ in the *Amazon DynamoDB Developer Guide*.

Filemanager

Name Type Size Permission Actions
wait Folder 0755
batch-get-item.rst File 1.95 KB 0644
batch-write-item.rst File 2.92 KB 0644
create-backup.rst File 860 B 0755
create-global-table.rst File 1.03 KB 0755
create-table.rst File 22.02 KB 0644
delete-backup.rst File 1.85 KB 0755
delete-item.rst File 2.8 KB 0644
delete-table.rst File 789 B 0644
describe-backup.rst File 1.89 KB 0755
describe-continuous-backups.rst File 745 B 0755
describe-contributor-insights.rst File 1.14 KB 0644
describe-endpoints.rst File 542 B 0755
describe-global-table-settings.rst File 1.55 KB 0755
describe-global-table.rst File 952 B 0755
describe-limits.rst File 576 B 0755
describe-table-replica-auto-scaling.rst File 4.11 KB 0755
describe-table.rst File 1.41 KB 0644
describe-time-to-live.rst File 551 B 0755
get-item.rst File 3.17 KB 0644
list-backups.rst File 7.38 KB 0644
list-contributor-insights.rst File 3.33 KB 0644
list-global-tables.rst File 739 B 0755
list-tables.rst File 2.79 KB 0644
list-tags-of-resource.rst File 2.34 KB 0644
put-item.rst File 2.68 KB 0644
query.rst File 6.88 KB 0644
restore-table-from-backup.rst File 2.17 KB 0755
restore-table-to-point-in-time.rst File 2.05 KB 0755
scan.rst File 1.48 KB 0644
tag-resource.rst File 510 B 0755
transact-get-items.rst File 2.02 KB 0644
transact-write-items.rst File 3.98 KB 0644
untag-resource.rst File 521 B 0755
update-continuous-backups.rst File 908 B 0755
update-contributor-insights.rst File 780 B 0644
update-global-table-settings.rst File 2.15 KB 0755
update-global-table.rst File 1.06 KB 0755
update-item.rst File 3.39 KB 0644
update-table-replica-auto-scaling.rst File 6.29 KB 0755
update-table.rst File 14.27 KB 0644
update-time-to-live.rst File 585 B 0755