title: How do you update a Set on DynamoDB using JavaScript document client?
body: <p>I'm trying to add some items to a DynamoDB set. This worked fine with the original JavaScript SDK, but not with the new DocumentClient, using the createSet() function. Here's my code:</p>
  
  <pre><code>'use strict';
  
  let docClient = new AWS.DynamoDB.DocumentClient({
                  region: 'us-east-2',
                  accessKeyId: 'AKIAJWIR35J4YZF4RQVQ',
                  secretAccessKey: 'xxxx'
              });
  
  var params = {
      TableName : 'qa_Web_Application',
      Key: {'Application_ID': '78f27a00-11f6-49cc-9adb-ae0795cf79d4'},
      UpdateExpression : 'ADD #idList :newIds',
      ExpressionAttributeNames : {
        '#idList' : 'ids'
      },
      ExpressionAttributeValues : {
        ':newIds' : docClient.createSet([1,2])
      }
  };
  
  console.log( params.ExpressionAttributeValues[":newIds"] );
  
  docClient.update(params, function(err,data) {
      if( err !== null ) {
          console.log( err, err.stack );
      } else {
          console.log ( data );
      }
  });
  </code></pre>
  
  <p>Here's the output:</p>
  
  <pre><code>constructor {values: Array(2), type: "Number"}
  Error: Invalid UpdateExpression: Incorrect operand type for operator or function; operator: ADD, operand type: MAP
  </code></pre>
  
  <p>I've seen this same question here (<a href="https://stackoverflow.com/questions/49521994/how-do-you-update-a-set-on-dynamodb-using-javascript-document-client">How do you update a Set on DynamoDB using JavaScript document client?</a>), but that's what I'm basing this code example on, and it fails.</p>