TypeORM-readme-35.ts
· 288 B · TypeScript
原始文件
import { Photo } from "./entity/Photo"
import { PhotoMetadata } from "./entity/PhotoMetadata"
import { AppDataSource } from "./index"
const photoRepository = AppDataSource.getRepository(Photo)
const photos = await photoRepository.find({
relations: {
metadata: true,
},
})
1 | import { Photo } from "./entity/Photo" |
2 | import { PhotoMetadata } from "./entity/PhotoMetadata" |
3 | import { AppDataSource } from "./index" |
4 | |
5 | const photoRepository = AppDataSource.getRepository(Photo) |
6 | const photos = await photoRepository.find({ |
7 | relations: { |
8 | metadata: true, |
9 | }, |
10 | }) |