TypeORM-readme-36.ts
· 292 B · TypeScript
Orginalformat
import { Photo } from "./entity/Photo"
import { PhotoMetadata } from "./entity/PhotoMetadata"
import { AppDataSource } from "./index"
const photos = await AppDataSource.getRepository(Photo)
.createQueryBuilder("photo")
.innerJoinAndSelect("photo.metadata", "metadata")
.getMany()
1 | import { Photo } from "./entity/Photo" |
2 | import { PhotoMetadata } from "./entity/PhotoMetadata" |
3 | import { AppDataSource } from "./index" |
4 | |
5 | const photos = await AppDataSource.getRepository(Photo) |
6 | .createQueryBuilder("photo") |
7 | .innerJoinAndSelect("photo.metadata", "metadata") |
8 | .getMany() |