QueryBuilder.where()
2026년 5월 17일
- TypeORM에서 쿼리빌더(QueryBuilder)를 실행할 때 특정 조건 즉, WHERE를 사용할 수 있는 메서드(Method)이다.
예시
- where()와 andWhere()를 사용하여 하나 혹은 이상의 필터링을 조건을 적용할 수 있다.
TypeScriptconst users = await connection.getRepository(User) .createQueryBuilder("user") .where("user.isActive = :isActive", { istActive: true }) .getMany();
- 아래는 여러 조건을 사용할 때 예시이다.
TypeScript