title: Convert collection of array to object
body: <p>I'm currently pushing array data. How can I return the object like this:</p>
  
  <pre><code>"data": [
      {
          "apartment": {
              {
                  "id": xxx,
                  "show": "xxx,
              },
              {
                  "id": xxx,
                  "show": "xxx",
              },
  </code></pre>
  
  <p>and not like this:</p>
  
  <pre><code> "data": [
      {
          "apartment": {
              "0": {
                  "id": xxx,
                  "show": "xxx,
              },
              "1" : {
                  "id": xxx,
                  "show": "xxx",
              },
  </code></pre>