title: How do I query an array in TypeORM
body: <p>I want to create user permissions management. I use TypeORM with PostgreSQL. This is the column definition for the permissions within the user entity:</p>
  <pre><code>@Column({
    type: 'text',
    array: true
  })
  permissions: UserPermission[] = [];
  </code></pre>
  <p>This is the <code>UserPermission</code> enum:</p>
  <pre><code>export enum UserPermission {
    APP_USER = 'APP_USER',
    USER_ADMIN = 'USER_ADMIN',
    SUPERADMIN = 'SUPERADMIN'
  }
  </code></pre>
  <p>I want to find one user who has the <code>'SUPERADMIN'</code> permission but I cannot find the right spot in the documentation / github issues which explains how to do this. I already spent over an hour on this and I suppose this is a simple task.</p>
  <p>Is there something like &quot;Includes&quot; to check if the permissions array includes a specific element and/or includes multiple elements?</p>
  <pre><code>const user = await this.userRepository.findOne({
    where: {
      permissions: Includes('SUPERADMIN')
    }
  });
  </code></pre>
  <p>I would be very thankful if someone could point me to the correct documentation page :)</p>
  <hr />
  <p>Edit:</p>
  <p>The following works for me but I think it is not optimal yet:</p>
  <pre><code>@Column('simple-json')
  permissions: string[];
  </code></pre>
  <pre><code>let user = await this.userRepository.createQueryBuilder('user')
    .where('user.permissions like :permissions', { permissions: `%&quot;${UserPermission.SUPERADMIN}&quot;%` })
    .getOne();
  </code></pre>