GetItem

Returns a single item by its primary key. O(1) key lookup with single-digit millisecond latency. The fastest DynamoDB operation.

Syntax

dynamodb
await docClient.send(new GetCommand({ TableName, Key }))

Example

dynamodb
const result = await docClient.send(new GetCommand({
  TableName: 'Users',
  Key: { PK: 'USER#alice', SK: 'PROFILE' },
}));
const user = result.Item;