title: How to update a Map or a List on AWS DynamoDB document API?
body: <p>The new <a href="http://aws.amazon.com/documentation/dynamodb/">AWS DynamoDB document API</a> allows 2 new data types that correspond directly to the underlying JSON representation: Map (aka JSON object) and List (aka JSON array).</p>
  
  <p>However, I can't find a way to update attributes of these data types without completely overwriting them. In contrast, a Number attribute can be updated by ADDing another number, so in Java you can do something like:</p>
  
  <pre><code>new AttributeUpdate("Some numeric attribute").addNumeric(17);
  </code></pre>
  
  <p>Similarly you can <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/document/AttributeUpdate.html">addElements</a> to an attribute of a Set data type. (In the old API you would use AttributeAction.ADD for both purposes.)</p>
  
  <p>But for a Map or a List, it seems you must update the previous value locally, then PUT it instead of that value, for example in Java:</p>
  
  <pre><code>List&lt;String&gt; list = item.getList("Some list attribute");
  list.add("new element");
  new AttributeUpdate("Some list attribute").put(list);
  </code></pre>
  
  <p>This is much less readable, and under some circumstances much less efficient.</p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li><p>Is there a way to update an attribute of a Map or a List data type without overwriting the previous value? For example, to add an element to a List, or to put an element in a Map?</p></li>
  <li><p>How would you implement it using the Java API?</p></li>
  <li><p>Do you know of plans to support this in the future?</p></li>
  </ol>