Zuletzt aktiv 1729146866

TypeORM-readme-48.ts Orginalformat
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()