title: NestJS design response structure
body: <p>How can I structure the response to a GET request from an async function? I could just return an object on a simple request but not in an async function. </p>
  
  <p>In the <a href="https://github.com/nestjs/nest/blob/1714b51375a66ade109ea6ae5de627740af5a302/sample/14-mongoose-base/src/cats/cats.controller.ts#L15" rel="nofollow noreferrer">cat sample</a> of the nestjs repository is, for example, a get request with an async function inside. </p>
  
  <pre><code>@Get()
  async findAll(): Promise&lt;Cat[]&gt; {
    return this.catsService.findAll();
  }
  </code></pre>
  
  <p>The response the array of cats. I don't understand how I modify the code so it looks like something like this. Instead of an array, I would like to respond with an object.</p>
  
  <pre><code>{
    "cats": 
    [
      {
        "name": "cat1",
        "age":2, 
        "breed":"test"
      },
      { 
        "name": "cat1",
        "age":2, 
        "breed":"test"
      }
    ]
  }
  </code></pre>