title: TypeORM: mapping unrelated entities into an array property
body: <p>I have the following <strong>unrelated</strong> TypeORM entities (for various reasons, I cannot use One/Many relationships on them):</p>
  <pre class="lang-js prettyprint-override"><code>@Entity()
  export class Book {
     @PrimaryGeneratedColumn()
     id: number;
  
     @Column()
     name: string;
  }
  
  @Entity()
  export class BookCategory {
     @PrimaryGeneratedColumn()
     id: number;
  
     @Column()
     bookId: number;
  
     @Column()
     name: string;
  }
  </code></pre>
  <p>With a single book, two assigned categories and the following query:</p>
  <pre class="lang-js prettyprint-override"><code>const query = this.bookRepository
        .createQueryBuilder('book')
        .leftJoinAndSelect(BookCategory, 'category', 'book.id = category.bookId');
  
  return query.execute();
  </code></pre>
  <p>I get the following response:</p>
  <pre class="lang-json prettyprint-override"><code>[
    {
      &quot;book_id&quot;: 1,
      &quot;book_name&quot;: &quot;Lorem Ipsum&quot;,
      &quot;category_id&quot;: 1,
      &quot;category_name&quot;: &quot;non-fiction&quot;
    },
    {
      &quot;book_id&quot;: 1,
      &quot;book_name&quot;: &quot;Lorem Ipsum&quot;,
      &quot;category_id&quot;: 2,
      &quot;category_name&quot;: &quot;documentary&quot;
    }
  ]
  </code></pre>
  <p>As you see, I get 2 objects. Is there any way I can get the following with a TypeORM query?</p>
  <pre class="lang-json prettyprint-override"><code>[
    {
      &quot;id&quot;: 1,
      &quot;name&quot;: &quot;Lorem Ipsum&quot;,
      &quot;categories&quot;: [&quot;non-fiction&quot;, &quot;documentary&quot;]
    }
  ]
  </code></pre>
  <p>I.e. I'm trying to bind a query result to a virtual property <code>categories</code>. Is that possible?</p>