1

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.

2
  • Do you want do find items with email1 as the single e-mail of the set or to find all items containing email1 in the set and return only this value ? Commented Oct 16, 2012 at 14:15
  • I need to find items that has a given email present in a set of one its attribute. Commented Oct 17, 2012 at 5:01

1 Answer 1

1

It seems like you are looking for the CONTAINS operator of Scan operation. It basically is the equivalent of in in 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: name
  • range_key: email

Of course, you would have to maintain this index yourself and query it manually.

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.