title: Compare uuid and string on TypeORM query builder
body: <p>I want to join 2 tables where user.id = photo.userId but the problem here is that the userId on photo table is varchar and that can't change. So I did a queryBuilder to join and the problem is here:</p>
  
  <pre><code>....
  .where(user.id = photo.userId)
  ....
  </code></pre>
  
  <p>this query throw an error: operator does not exists: uuid = character varying</p>
  
  <p>Is there any way to make this work?</p>
  
  <p>Note: My project is a NestJS API, using TypeORM and Postgresql.</p>
  
  <p><strong>EDIT</strong>
  I already have the Photo result and use it on a subQuery:</p>
  
  <pre><code>query = query
           .where(qb =&gt; {
                const subQuery = qb.subQuery()
                .select('user.id')
                .from(User, 'user')
                .where('user.id = photo.userId)
                .getQuery();
                return 'EXISTS' + subQuery;
            });
  </code></pre>