title: Dynamodb - Update value of JSON object in array of objects
body: <p>Below is a sample item object/record stored in DynamoDb. I use NodeJS and <code>AWS.DynamoDB.DocumentClient</code> to access the database. </p>
  
  <p>I'm building out a PUT function to update the status for an JSON object in an array. The function will have access to the Item's <code>uuid</code> and room's <code>uuid</code>. How can I simply (creatively) update the value of corresponding <code>status</code> field, given the array of JSON objects? </p>
  
  <p>Params:</p>
  
  <pre><code>let params = {
    TableName: room-table,
    Key: {
      uuid: event.body.uuid
    },
    UpdateExpression : "??",
    ExpressionAttributeNames: {
        "??":"??"
    },
    ExpressionAttributeValues:{
      "??":"??"
    },
    ReturnValues:"ALL_NEW"
  };
  </code></pre>
  
  <p>Item Object:</p>
  
  <pre><code>{
    "Item": {
      "uuid": "77b1e88e-5e60-44d9-b6ca-aec345c0dc99",
      "rooms": [
        {
          "room": "303",
          "status": "pending",
          "uuid": "b8f1c1a8-04a9-4c2e-82ad-bc3e81face35"
        },
        {
          "room": "302",
          "status": "pending",
          "uuid": "42fdc61a-4a25-4316-90c9-60209875d208"
        },
        {
          "room": "678",
          "status": "pending",
          "uuid": "7bedc115-20ed-4c3e-9cd7-7fed0520f4df"
        }
      ],
      "status": "pending"
    }
  }
  </code></pre>