title: DynamoDB update duplicates records in List field
body: <p>I'm performing an update (or create if it doesn't exist) on a DynamoDB table with the following params:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;TableName&quot;: &quot;TableName&quot;,
      &quot;Key&quot;: {
          &quot;PartitionKey&quot;: &quot;TEST#&quot;,
          &quot;SortKey&quot;: &quot;SK#123456&quot;
      },
      &quot;UpdateExpression&quot;: &quot;set WaterTests = list_append(if_not_exists(WaterTests, :empty_list), :waterTestValues),  MakeModel = :mm, Version = :v, Username = :username&quot;,
      &quot;ExpressionAttributeValues&quot;: {
          &quot;:waterTestValues&quot;: [
              {
                  &quot;DateTest&quot;: &quot;2022-03-29T09:40:50.985Z&quot;,
                  &quot;IsValid&quot;: true,
                  &quot;S3Path&quot;: &quot;sample/s3/path&quot;
              }
          ],
          &quot;:v&quot;: &quot;v1&quot;,
          &quot;:mm&quot;: &quot;No Make Model&quot;,
          &quot;:username&quot;: &quot;no.user@redacted.com&quot;,
          &quot;:empty_list&quot;: []
      },
      &quot;ReturnValues&quot;: &quot;UPDATED_NEW&quot;
  }
  </code></pre>
  <p>It invariably results in the following (for a non existing record, unique HK+SK):</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;PartitionKey&quot;: &quot;SESSION#&quot;,
      &quot;SortKey&quot;: &quot;USER#no.user@redacted.com#999fe1b3-0b59-4a41-9eef-37d433566af0&quot;,
      &quot;WifiTests&quot;: [
      {
      &quot;DateTest&quot;: &quot;2022-03-29T09:40:50.985Z&quot;,
      &quot;IsValid&quot;: true,
      &quot;S3Path&quot;: &quot;sample/s3/path&quot;
      },
      {
      &quot;DateTest&quot;: &quot;2022-03-29T09:40:50.985Z&quot;,
      &quot;IsValid&quot;: true,
      &quot;S3Path&quot;: &quot;sample/s3/path&quot;
      }
      ]...
  </code></pre>
  <p>I'm using a standard update call as follows:</p>
  <pre class="lang-js prettyprint-override"><code>await docClient.update(params, function (err, data) {
          if (err) console.log(err);
          else console.log(data);
      }).promise();
  </code></pre>
  <p>I have no clue on why the duplication always happens.</p>