The DynamoDB Condition Expressions Reference documentation is your friend!
In your specific case you can use the contains function to search for a sub-string. Your filter expression might look something like this:
"attr1 = :val1 and attr2 = :val2 and (contains(attr3, :val3a) or contains(attr3, :val3b))"
// where :val3a and :val3b are value placeholders for say AAA and BBB
But I suspect that what you want to achieve is a bit more sophisticated than can be handled server-side by DynamoDB filters, so you have two options:
- do the filtering in the application logic (ie. bring down your
results to the client and filter there), or;
- change your attribute
from a string to a list, or string set (if duplicates not allowed)
In either case, you should know that a scan with filters is only more efficient than a regular scan in terms of network band-with (in the case when most results are excluded by the filter). But in terms of capacity consumed a Scan is equally expensive with or without filters. So if you can avoid it, don't rely on scanning your table too much!