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

AttributesToGet

AttributesToGet is an array of one or more attributes to retrieve from DynamoDB. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.

AttributesToGet allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.

Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.

Use ProjectionExpression Instead

Suppose you wanted to retrieve an item from the Music table, but that you only wanted to return some of the attributes. You could use a GetItem request with an AttributesToGet parameter, like this:

{
    TableName: "Music", 
    AttributesToGet: 
        ["Artist", "Genre"], 
    Key: {
        SongTitle: {"Call Me Today"}, 
        Artist: {"No One You Know"}
}

But you could use a ProjectionExpression instead:

{
    TableName: "Music", 
    ProjectionExpression: "Artist, Genre", 
    Key: {
        SongTitle: {"Call Me Today"}, 
        Artist: {"No One You Know"}
}