Read Data from DynamoDB with get-item and query
Beginner · 30 minutes · 5 tasks, checked automatically · 100 points
In this foundational lab you will create a DynamoDB table, populate it with sample items, and then practice the two most common read operations: `get-item` (fetch a single item by its exact primary key) and `query` (fetch multiple items that share a partition key). By the end you will understand when to use each operation and how to filter and project the attributes you need.
What you’ll learn
- Create a DynamoDB table with a composite primary key (partition key + sort key)
- Write multiple items into the table using put-item
- Retrieve a single item precisely using get-item with a full primary key
- Retrieve multiple items for a partition key using query with a KeyConditionExpression
- Narrow query results using FilterExpression and ProjectionExpression
How this lab works
- Start the lab: One click starts an emulated cloud on your computer, with the cloud’s own CLI ready: no account and no bill.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads the emulated cloud’s resources and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: An emulated cloud on your computer: no cloud account, no bill
- Cloud: AWS
- Services: dynamodb
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop (or Podman / Rancher Desktop) installed and running
- A AWS sandbox created in the Local Cloud Playground
Topics: dynamodb, get-item, query, nosql, aws, read-operations, key-condition, filter-expression, projection
Create a free account to start this lab.
Keep going
- Create Your First S3 Bucket and Upload an Object
- List, Copy and Delete S3 Objects with the AWS CLI
- Turn On S3 Versioning and Recover an Overwritten File
- Create a DynamoDB Table and Write Your First Item
- Send and Receive Your First Message with an SQS Queue
- Publish to an SNS Topic and Deliver to an SQS Queue