160k views
1 vote
What can GetItem query by?

(A) Primary key attributes only
(B) Sort key attributes only
(B) Primary key attributes or sort key attributes
(C) Any attribute in the table

1 Answer

5 votes

Final answer:

The GetItem query in AWS DynamoDB can query by either Primary key attributes or sort key attributes of a table.

Step-by-step explanation:

The GetItem query in AWS DynamoDB can query by either Primary key attributes or sort key attributes of a table.

If you provide the primary key only, DynamoDB will return the item with the specified primary key attributes. If you provide both the primary key and sort key, DynamoDB will return the item with matching values for both attributes.

However, it's important to note that you cannot query by any attribute in the table, you can only query by the primary key attributes or sort key attributes.

User Arno Van Lieshout
by
8.1k points