I need to design a script that queries dynamoDB with a list of elements.
I've already tried looping over every element of the list, and querying that element and appending the result, but I was wondering if there is a more efficient way of performing that operation.
KeyConditionExpression=Key('id').eq('occupation') & Key('sort').begins_with(locations + '#' + occup + '#' + contract)
The code I've shown above performs a query for a single location, but instead of just one I wonder if I use the list and sort of lower the number of queries.
EG
locations = ['Glasgow','London']
and the result of this to be elements with both locations.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.