Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AttributesToGet (legacy)

Focus mode
AttributesToGet (legacy) - Amazon DynamoDB
Note

We recommend that you use the new expression parameters instead of these legacy parameters whenever possible. For more information, see Using expressions in DynamoDB. For specific information on the new parameter replacing this one, Use ProjectionExpression instead.

The legacy conditional parameter 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 – Example

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, as in this AWS CLI example:

aws dynamodb get-item \ --table-name Music \ --attributes-to-get '["Artist", "Genre"]' \ --key '{ "Artist": {"S":"No One You Know"}, "SongTitle": {"S":"Call Me Today"} }'

You can use a ProjectionExpression instead:

aws dynamodb get-item \ --table-name Music \ --projection-expression "Artist, Genre" \ --key '{ "Artist": {"S":"No One You Know"}, "SongTitle": {"S":"Call Me Today"} }'
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.