The GetItem operation returns a set of attributes for the item with the
given primary key. If there is no matching item, GetItem does not return
any data and there will be no Item element in the response.
GetItem provides an eventually consistent read by default. If your
application requires a strongly consistent read, set ConsistentRead to
true. Although a strongly consistent read might take more time than an
eventually consistent read, it always returns the last updated value.
example
Use a bare-bones client and the command you need to make an API call.
The
GetItem
operation returns a set of attributes for the item with the given primary key. If there is no matching item,GetItem
does not return any data and there will be noItem
element in the response.GetItem
provides an eventually consistent read by default. If your application requires a strongly consistent read, setConsistentRead
totrue
. Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value.Use a bare-bones client and the command you need to make an API call.
import { DynamoDBClient, GetItemCommand } from "@aws-sdk/client-dynamodb"; // ES Modules import // const { DynamoDBClient, GetItemCommand } = require("@aws-sdk/client-dynamodb"); // CommonJS import const client = new DynamoDBClient(config); const command = new GetItemCommand(input); const response = await client.send(command);
GetItemCommandInput for command's
input
shape.GetItemCommandOutput for command's
response
shape.config for DynamoDBClient's
config
shape.