title: How to represent meta data in JSON
body: <blockquote>
    <p>Note: this is a NodeJs app</p>
  </blockquote>
  
  <p>I have the following JSON object that stores questions and answers:</p>
  
  <pre><code>{
      "id": "SOME_GUID",
      "questions": {
          "page-1": {
              // ... JSON schema for page 1.
          },
          "page-2": {
              // ... JSON schema for page 2.
          }
      },
      "answers": {
          "page-1": {
              "page-1-question-1": "something"
          },
          "page-2": {
              "page-2-question-1": true,
              "page-2-question-2": "foo"
          },
      }
  
  }
  </code></pre>
  
  <p>Is there a benefit of representing the data in a specific way over another? I would naturally opt for a simple key/value pair notation (shown below) as it seems to fit the bill here. But I have seen the "array notation" (shown below) in the wild (in projects written in Java)</p>
  
  <p>key/value pair notation (what I would naturally use):</p>
  
  <pre><code>{
      "meta": {
          "createdData": "some date",
          "modifiedData": "some date",
          "referenceNumber": "some reference number",
          "type": "some type code"
      }
  }
  </code></pre>
  
  <p>or</p>
  
  <p>"array" notation</p>
  
  <pre><code>{
      "meta": [
          {
              "key": "createdDate",
              "value": "some date"
          },
          {
              "key": "modifiedData",
              "value": "some date"
          },
          {
              "key": "referenceNumber",
              "value": "some reference number"
          },
          {
              "key": "type",
              "value": "some type code"
          },
      ]
  }
  
  </code></pre>