I have a String Set attribute i.e SS in a dynamodb table. I need to scan the database to check the value present in the any one list of the items.
Which comparison operator should I use for this scan?
example the db has items like this:
- name
- [email1, email2]
- phone
I need to search for a items containing a particular email say email1 alone not giving the entire tuple.
It seems like you are looking for the
CONTAINSoperator ofScanoperation. It basically is the equivalent ofinin Python.This said, if you need to perform this often, you probably should de-normalize your data to make it faster.
For example, you could build a second table like this:
hash_key: namerange_key: emailOf course, you would have to maintain this index yourself and query it manually.