I'm new to Amazon DynamoDB and I want to get records according to creator id. I made one partition key and after made query
var params = {
TableName: process.env.TABLE_PARTS,
IndexName: "createdBy-index",
KeyConditionExpression: "createdBy = :createdBy",
ExpressionAttributeValues: {":createdBy": "abus282jehbhwdubunids"}
}
const data = await db.query(params).promise();
res.send(data);
But I am getting data = null
To learn how to successfully use the AWS SDK for JavaScript to query Amazon DynamoDB tables, see the AWS SDK for JavaScript DEV Guide. Specifically refer to this topic:
See the example under Getting an item.
This DEV guide has the information you need to successfully use this SDK.