title: Union of sets query
body: <p>I'm creating items in DynamoDB as sets, something like:</p>
  
  <pre><code>ddb.updateItem({TableName: table, Key: key {Category: {S: categoryName}},
      AttributeUpdate: {MySet: {Action: "ADD", Value: {SS: [ValueToAdd]}}}
  });
  </code></pre>
  
  <p>This works great and <code>MySet</code> is appropriately populated per category.</p>
  
  <p>Now, I want to get the union of all sets from a given list of categories.  Let's say I have:</p>
  
  <pre><code>tip: [1, 2, 3],
  foo: [1, 3, 5],
  bar: [3, 5, 7],
  </code></pre>
  
  <p>And I want to get all of the set values for <code>tip</code>, <code>foo</code>, and <code>bar</code> -- the result would be <code>1, 2, 3, 5, 7</code>.  For just <code>tip</code> and <code>foo</code> it would be <code>1, 2, 3, 5</code>, etc.</p>
  
  <p>I can do this by using <code>ddb.query</code> for each individual category to get the set and then getting the union of the set in JavaScript, but the sets may be relatively large so it may be better to do it through a query. I see that <code>UNION</code> is a keyword in DynamoDB, but I can't seem to find any more information on it.</p>
  
  <p>Is it possible to get a union of sets from a DynamoDB query?</p>