title: Is it possible to do a conditional put or update in DynamoDB?
body: <p>Let's say that I am storing records with following structure in DynamoDB:</p>
  
  <pre><code>{    
      "id": "57cf5b43-f9ec-4796-9de6-6a50f556cfd8",
      "created_at": "2015-09-18T13:27:00+12:00",
      "count": 3
  }
  </code></pre>
  
  <p>Now, is it possible to achieve the following in one request:  </p>
  
  <ul>
  <li>if the record with given <code>id</code> doesn't exist it should be created with count = 1</li>
  <li>if the record for that <code>id</code> exists the counter is being updated.</li>
  </ul>
  
  <p>Currently I'm doing a query to check if the record exist and depending on the result I do a <code>put</code> or an <code>update</code>. It would be nice to fold that into a single operation.</p>