4

Using Node.js, I'm querying DynamoDB for objects using a secondary index:

TableName: "Products",
IndexName: 'MerchantAndDateIndex',
KeyConditionExpression: "#creator = :creatorId",
ExpressionAttributeNames:{
    "#creator": "createdBy"
},
ExpressionAttributeValues: {
    ":creatorId": uuid
}

What I want to do is query the "Products" table with the "createdBy" hash key accepting several different possible strings, something like this:

ExpressionAttributeValues: {
    ":creatorId": ["multiple","valid","uuids","here"]
}

Where every element in my dynamic array is checked against the ID in the table when running a query.

Of course, this specific implementation returns a type mismatch, but I'm not sure how to do this correctly

1 Answer 1

4

This is not supported by the DynamoDB API, and it would still count as multiple read requests from DynamoDB's throughput perspective.

If you need to query for multiple values you would need to implement that logic yourself in your application. Basically write a loop over the values to query and issue a query for each. That's what Dynamo would do server-side anyway.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.