title: update an item adding an attribute in dynamodb
body: <p>Is it not possible to add an attribute in dynamodb dynamically?</p>
  
  <p>I got this error when I tried-"<strong>The provided key element does not match the schema</strong>".</p>
  
  <p>Scenario - </p>
  
  <pre><code>{ id : "123",
    imageName : "elephant.jpg"
  }
  </code></pre>
  
  <p>I want to add an attribute - imagePath : "/path/to/image" to the above data.
  I used put_item, but it replaces the old item if exists.</p>
  
  <p>I am searching for the solution for - If id = "123", then add imagePath attribute else add a new item to the table.</p>
  
  <p>Adding an attribute can be achieved using put_item but it will replace the existing item. <strong>How can we dynamically add an attribute to the existing data using update_item ?</strong> (appending imagePath to the the given json)</p>
  
  <p><strong>Should I alter the schema of the table with imagePath and then use update_item function?</strong></p>
  
  <p>How can we achieve this using python?</p>