title: typeorm how to leftjoin with count without relation
body: <p>I have <code>user</code> entity and <code>follow</code> entity as following currently.</p>
  <pre><code>export class Follow extends BaseEntity {
  
      @PrimaryGeneratedColumn()
      id!: number;
  
      @Column()
      userId: number;
  
      @Column()
      followingId: number;
  }
  
  export class User extends BaseEntity {
    @PrimaryGeneratedColumn()
    id!: number;
  
    @Column({ unique: true })
    username!: string;
  }
  </code></pre>
  <p>The current code to retrieve user, which works fine.</p>
  <pre><code>      const u = await getRepository(User).createQueryBuilder(&quot;user&quot;).where(&quot;user.id = :id&quot;, { id: id})
          .leftJoinAndMapMany(&quot;user.following&quot;, Follow, &quot;following&quot;, &quot;user.id = following.userId&quot;)
          .leftJoinAndMapMany(&quot;user.follower&quot;, Follow, &quot;follower&quot;, &quot;user.id = follower.followingId&quot;)
          .getOne();
  
          u.followingCount = u.following.length;
          u.followerCount = u.follower.length;
  </code></pre>
  <p>it will produce the following result as example:</p>
  <pre><code>User {
    id: 1,
    username: &quot;sample&quot;,
    follower: [
      Follow {
       id: 5,
       userId: 1,
       followingId: 3,
      }
    ],
    following: [
      Follow {
       id: 4,
       userId: 3,
       followingId: 1,
      }
    ],
    followingCount: 1,
    followerCount: 1
  }
  </code></pre>
  <p>I wonder there are any ways I can use <code>typeORM</code> in-build function, upon the above code, to put all 4 following properties under a <code>follow</code> field, and also do the <code>COUNT</code> at the same time. So it would look like the following:</p>
  <pre><code>User {
    id: 1,
    username: &quot;sample&quot;,
    follow: {
      follower: [],
      following: [],
      followingCount,
      followerCount
    }
  }
  </code></pre>
  <p><strong>Note:</strong> I know I can use <code>@ManyToMany</code> for two entities, and my example appears to be the case.
  but there are many cases that two table has no relationship but we still want to join them together.
  I try to bring the idea into a more general situation so it can be used regardless the relation is built. And also better understand the <code>typeORM</code> in-build functions.</p>
  <p>Any suggestions are appreciated.</p>