I'm trying to use a Scan operation on a DynamoDB table to match items with given 'tags'. The tags for an item are stored in a single set attribute. E.g.:
machine-1: tags = "windows", "iis", "64bit" machine-2: tags = "windows", "fs"
Now, I have a support case open with Premium Support, but it's taking some amount of time. What I want to do is match machines where 'tags' contains the entry "windows" and "iis".
I can match a single one by using the CONTAINS
mode, and specifying a single AttributeValue with a string value of "windows", for example.
However, CONTAINS
does not support sets in a single AttributeValue, or multiple AttributeValues. It gives an error.
So I tried IN
(something AWS premium support also suggested): however, whether I use a single AttributeValue (even just looking for "windows" again or multiple ones), I get zero results.
The documentation for IN
is pretty poor. The operation is described in 4 uninformative words, in fact: "checks for exact matches".
While I wait for support possibly going on with a few more rounds of Q&A, is anyone reading this familiar with this kind of query with Scan? (If you could, please test what you're saying in your answer first: I think I have tried the obvious ones!)
For ref, Scan documentation: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_Scan.html