
Answer-first summary for fast verification
Answer: Create a GSI with customer_type as the partition key and email_address as the sort key, then query using begins_with on email_address.
The correct answer is A. This approach is correct because it allows for efficient querying of items based on the customer_type. By creating a global secondary index (GSI) with customer_type as the partition key and email_address as the sort key, the developer can then perform a query operation on the GSI using the begins_with key condition expression with the email_address property. This setup facilitates partial matches. GSIs are versatile and can be added to existing tables, which makes this solution suitable since the developer does not want to recreate the DynamoDB table.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can a developer enable a Lambda function to perform partial match searches on email addresses within a specific customer type in a DynamoDB table, without needing to recreate the table?
A
Create a GSI with customer_type as the partition key and email_address as the sort key, then query using begins_with on email_address.
B
Create a GSI with email_address as the partition key and customer_type as the sort key, then query using begins_with on email_address.
C
Create an LSI with customer_type as the partition key and email_address as the sort key, then query using begins_with on email_address.
D
Create an LSI with job_title as the partition key and email_address as the sort key, then query using begins_with on email_address.
No comments yet.