DynamoDB Expression Terms Reference documentation is your friend!
In your specific case, you can use the contains function to search for substrings. 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 complicated than the DynamoDB filters can handle the server, so you have two options:
- perform filtering in the application logic (i.e., remove the results to the client and the filter there), or;
- change your attribute from row to list or rowset (if duplicates are not allowed)
In any case, you should know that scanning with filters is more effective than conventional scanning in terms of network bandwidth (in the case when most of the results are excluded by the filter). But in terms of power consumption, scanning is equally expensive with or without filters. Therefore, if you can avoid this, do not rely too much on scanning the table!
source share