DynamoDB Code Examples — Copy-Paste Snippets
Ready-to-run DynamoDB snippets for every operation and language — copy, adapt, and build it visually with the Expression Builder.
Reading items
DynamoDB GetItem in Node.js (AWS SDK v3)
Read a single DynamoDB item by its primary key in Node.js with AWS SDK v3 — a complete, runnable GetItemCommand example with the client, key marshalling, and the response shape.
DynamoDB GetItem in Python (boto3)
Read a single DynamoDB item by its primary key in Python with boto3 — a complete, runnable get_item example using the resource API, Decimal numbers, and the response shape.
DynamoDB GetItem with the AWS CLI
Read a single DynamoDB item by its primary key from the AWS CLI — a complete, runnable get-item command with the DynamoDB JSON key format, projection, and consistent-read flag.
Writing items
DynamoDB PutItem in Node.js (AWS SDK v3)
Write a DynamoDB item in Node.js with AWS SDK v3 — a complete, runnable PutItemCommand example with the item's attributes and a ConditionExpression to prevent overwrites.
DynamoDB PutItem in Python (boto3)
Write a DynamoDB item in Python with boto3 — a complete, runnable put_item example using native types, Decimal for numbers, and a ConditionExpression to prevent overwrites.
DynamoDB PutItem with the AWS CLI
Write a DynamoDB item from the AWS CLI — a complete, runnable put-item command with the DynamoDB JSON item format and a condition-expression to prevent overwrites.
DynamoDB UpdateItem in Node.js (AWS SDK v3)
Update a DynamoDB item in Node.js with AWS SDK v3 — a complete, runnable UpdateItemCommand example with SET, an atomic counter, ReturnValues, and reserved-word aliases.
DynamoDB UpdateItem in Python (boto3)
Update a DynamoDB item in Python with boto3 — a complete, runnable update_item example with SET, an atomic ADD counter, ReturnValues, Decimal, and reserved-word aliases.
DynamoDB UpdateItem with the AWS CLI
Update a DynamoDB item from the AWS CLI — a complete, runnable update-item command with SET, an atomic ADD counter, return-values, and reserved-word aliases.
Querying & scanning
DynamoDB Query in Node.js (AWS SDK v3)
Query a DynamoDB partition in Node.js with AWS SDK v3 — a complete, runnable QueryCommand example with KeyConditionExpression, sort-key condition, and LastEvaluatedKey pagination.
DynamoDB Query in Python (boto3)
Query a DynamoDB partition in Python with boto3 — a complete, runnable query example using the Key condition helper, sort-key filter, and LastEvaluatedKey pagination.
DynamoDB Query with the AWS CLI
Query a DynamoDB partition from the AWS CLI — a complete, runnable query command with key-condition-expression, expression-attribute-values, and how CLI auto-pagination works.
DynamoDB Scan in Node.js (AWS SDK v3)
Scan a DynamoDB table in Node.js with AWS SDK v3 — a complete, runnable ScanCommand example with FilterExpression, LastEvaluatedKey pagination, and why Scan is a last resort.
DynamoDB Scan in Python (boto3)
Scan a DynamoDB table in Python with boto3 — a complete, runnable scan example using the Attr filter helper, LastEvaluatedKey pagination, and why Scan is a last resort.
DynamoDB Scan with the AWS CLI
Scan a DynamoDB table from the AWS CLI — a complete, runnable scan command with filter-expression, CLI auto-pagination, parallel-scan segments, and why Scan is a last resort.
Trabaja con DynamoDB sin la Consola
DynoTable es un cliente de escritorio rápido para DynamoDB: explora tablas, ejecuta consultas estilo SQL y edita Items localmente.