Last active 1729146866

Revision 8998247a655be289fb63a053ec0c4efe63776471

TypeORM-readme-48.ts Raw
1const photos = await AppDataSource.getRepository(Photo)
2 .createQueryBuilder("photo") // first argument is an alias. Alias is what you are selecting - photos. You must specify it.
3 .innerJoinAndSelect("photo.metadata", "metadata")
4 .leftJoinAndSelect("photo.albums", "album")
5 .where("photo.isPublished = true")
6 .andWhere("(photo.name = :photoName OR photo.name = :bearName)")
7 .orderBy("photo.id", "DESC")
8 .skip(5)
9 .take(10)
10 .setParameters({ photoName: "My", bearName: "Mishka" })
11 .getMany()