Menu
Amazon DynamoDB
Getting Started Guide (API Version 2012-08-10)

Step 2: Get Information About Tables

DynamoDB stores detailed metadata about your tables, such as table name, its primary key attributes, table status, and provisioned throughput settings. In this section you retrieve information about the music table using the DynamoDB DescribeTable operation and also obtain a list of tables using the ListTables operation.

Step 2.1: Retrieve a Table Description

Use the DynamoDB DescribeTable operation to view details about a table.

  1. Replace everything in the left side of the DynamoDB JavaScript shell window with the following code:

    
    var params = {
        TableName: "Music"
    };
    
    dynamodb.describeTable(params, function(err, data) {
        if (err)
            console.log(JSON.stringify(err, null, 2));
        else
            console.log(JSON.stringify(data, null, 2));
    });
    
    
  2. Click the play button arrow to run the code. The response from DynamoDB contains a complete description of the table.

Step 2.2: Retrieve a List of Your Tables

Use the ListTables API operation to list the names of all of your tables. This operation does not require any parameters.

  1. Replace everything in the left side of the DynamoDB JavaScript shell window with the following code:

    
    var params = {};
    
    dynamodb.listTables(params, function(err, data) {
        if (err)
            console.log(JSON.stringify(err, null, 2));
        else
            console.log(JSON.stringify(data, null, 2));
    });
    
    
  2. Click the play button arrow to run the code. The response from DynamoDB contains just one table called Music.