title: Create nested maps in DynamoDB
body: <p>I am trying to create a new map and also assign it a new value at the same time</p>
  <p>This is the data format I want to store in my db:</p>
  <pre><code>{
      &quot;user_id&quot;: 1,
      &quot;project_id&quot;: 1,
      &quot;MRR&quot;: {
           &quot;NICHE&quot;: {
               &quot;define your niche&quot;: {
                     &quot;vertical&quot;: &quot;test&quot;,
                     &quot;ideal prospect&quot;: &quot;He is the best&quot;
               }
           },
           &quot;Environment&quot;: {
               &quot;Trend 1&quot;: {
                     &quot;description&quot;: &quot;something&quot;
               },
               &quot;Trend 2&quot;: {
                     &quot;description&quot;: &quot;something else&quot;
               }
           }
  
      }
  
  }
  </code></pre>
  <p>My code so far for inserting data is:</p>
  <pre><code>def update_dynamo(user_id, project_id, group, sub_type, data):
      dynmoTable.update_item(
          Key = {
              &quot;user_id&quot;: user_id
          },
          ConditionExpression=Attr(&quot;project_id&quot;).eq(project_id),
          UpdateExpression=&quot;SET MRR.#group = :group_value&quot;,
          ExpressionAttributeNames={
              &quot;#group&quot;: group
          },
          ExpressionAttributeValues={
              &quot;:group_value&quot;: {}
          }
      )
  
      dynmoTable.update_item(
          Key={
              &quot;user_id&quot;: user_id
          },
          ConditionExpression=Attr(&quot;project_id&quot;).eq(project_id),
          UpdateExpression=&quot;SET MRR.#group.#subgroup = :sub_value&quot;,
          ExpressionAttributeNames={
               &quot;#group&quot;: group,
               '#subgroup': sub_type
          },
          ExpressionAttributeValues={
               &quot;:sub_value&quot;: data
          }
       )
  data = {
      &quot;description&quot;: &quot;world&quot;,
  }
  if __name__ == &quot;__main__&quot;:
      update_dynamo(1, 1, &quot;New Category&quot;, &quot;Hello&quot;, data)
  </code></pre>
  <p>My question is can these 2 update_items somehow be merged into one?</p>