DynamoDB: Get All Items (Guide w/ Code Examples)

Provided by Rafal Wilinski
Last updated: October 23rd, 2026
Scan reads one page at a time. Continue with LastEvaluatedKey until it is absent, processing each page as it arrives instead of loading the whole table into memory.
Install @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb, use an ES module on a supported Node.js runtime, and configure an AWS Region and credentials. The examples use an existing Orders table with String keys pk and sk unless an index or timestamp key is described.
import { DynamoDBClient } from "@aws-sdk/client-dynamodb"; import { DynamoDBDocumentClient, ScanCommand } from "@aws-sdk/lib-dynamodb"; const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({})); let lastKey; do { const page = await ddb.send(new ScanCommand({ TableName: "Orders", ExclusiveStartKey: lastKey, })); for (const item of page.Items ?? []) console.log(item); lastKey = page.LastEvaluatedKey; } while (lastKey && Object.keys(lastKey).length > 0);
Scans consume read capacity and do not provide a snapshot. Prefer Query for application lookups or export to S3 for large analytical jobs.
Reference: AWS Scan API. For related access patterns, see DynamoDB query examples.
Similar Code Examples
- DynamoDB: Get Last Inserted Item
- DynamoDB: Get By ID
- DynamoDB: Delete Table
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Query Date Range
- DynamoDB: BatchGetItem
- DynamoDB: Query Items
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Query Ends With
- DynamoDB: GetItem
- DynamoDB Get in Typescript
- DynamoDB: Attribute Not Null
- DynamoDB: Query JSON
- DynamoDB: Increment Counter
- DynamoDB: Create if Not Exists
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
- SSH GUI Client
- Chat With Cloud
- MongoDB GUI Client
- AWS Cost Monitoring
- DynamoDB Query Builder
- DynamoDB Code Examples
- DynamoDB Node.js Queries
- DynamoDB JSON Converter
- DynamoDB UUID Generator
- DynamoDB Local Admin GUI
- DynamoDB Pricing Calculator
- DynamoDB Single-Table Design
- Best DynamoDB GUI Clients
- Dynobase vs DynoTable
DynamoDB Info
© 2026 Dynobase