DynamoDB: Query JSON (Guide w/ Code Examples)
JavaScript AWS SDK does not provide a specific method to query data as JSON. But you can use the query
operation to get data as an array and pass the result to JSON.stringify
method to convert the array to a JSON string.
const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const params = { TableName: 'tableName', KeyConditionExpression: 'primaryKey = :primaryKeyValue', ExpressionAttributeValues: { ':primaryKeyValue': 'value' } }; dynamoDb.query(params, (error, data) => { if (error) { console.error(error); return; } console.log(JSON.stringify(data.Items)); });
Similar Code Examples
- DynamoDB: Query Count
- DynamoDB: Attribute Not Null
- DynamoDB: Query Ends With
- DynamoDB: Bulk Insert
- DynamoDB: Get Last 10 Records
- DynamoDB: Get List Of Items
- DynamoDB: Query Group By
- DynamoDB: Query Date Range
- DynamoDB: Query KeyConditionExpression
- DynamoDB: Not Begins With
- DynamoDB: Delete Table
- DynamoDB: Delete
- DynamoDB: Like
- DynamoDB: Get Unique Values
- DynamoDB: Get Random Item
Dynobase is a Professional GUI Client for DynamoDB
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2023 Dynobase