title: typeorm find row by array of ids of another table but all values in this array must be present in one relation
body: <p>I'm working on a chatting app.</p>
  <p>I have table messages_thread:</p>
  <pre><code>@Entity(&quot;messages_thread&quot;)
  export class MessagesThreadEntity {
  
      @PrimaryColumn({
          type: 'bigint',
          name: 'id',
      })
      id: number;
  
      @OneToMany(type =&gt; MessagesThreadUsersEntity, a=&gt; a.thread)
      users!: MessagesThreadUsersEntity[];
  
      constructor(init?: Partial&lt;MessagesThreadEntity&gt;) {
          Object.assign(this, init);
      }
  }
  </code></pre>
  <p>And table messages_thread_users</p>
  <pre><code>@Entity(&quot;messages_thread_users&quot;)
  export class MessagesThreadUsersEntity {
  
      @PrimaryColumn({
          type: 'bigint',
          name: 'id',
      })
      id: number;
  
      @Column(&quot;bigint&quot;, {
          nullable: false,
          name: 'user_id',
      })
      user_id: number;
  
      @Column(&quot;bigint&quot;, {
          nullable: false,
          name: 'thread_id',
      })
      thread_id: number;
  
      @ManyToOne(type =&gt; MessagesThreadEntity, a =&gt; a.users)
      @JoinColumn({
          name: 'thread_id',
          referencedColumnName: 'id'
      })
      thread!: MessagesThreadEntity;
  
      constructor(init?: Partial&lt;MessagesThreadUsersEntity&gt;) {
          Object.assign(this, init);
      }
  }
  </code></pre>
  <p>I'm trying to use createQueryBuilder to do a complicated query where I need to get the thread that has users matched to the 'user_ids' array. But there is a catch, this thread should have all these users I'm looking for, no more or fewer users.</p>
  <p>example:
  I'm looking for the thread that has user_ids = [1,2,5], and I have these threads:</p>
  <ul>
  <li>thread A has users [1,2,3,4,5,6]</li>
  <li>thread B has users [2,5]</li>
  <li>thread C has users [1,2,5]</li>
  </ul>
  <p>In this case, I want thread C to be returned from the database.</p>
  <p>NOT thread A since it has more users than [1,2,5]</p>
  <p>NOT thread B since it does not have all the users that I want.</p>
  <p>I need the thread that has exactly the array I'm looking for, which is thread C.</p>
  <p>What I did so far:</p>
  <pre><code>  let threadUsers = await this.messagesThreadUsersRepo.createQueryBuilder() 
   .select() 
   .where('affiliate_id IN (:...allUserIds)', { allUserIds }) 
   .getMany(); 
  </code></pre>
  <p>NOTE: I am using NestJs, and the database is MySQL</p>