knox 修订了这个 Gist . 跳至此修订
1 file changed, 10 insertions
TypeORM-readme-35.ts(file created)
@@ -0,0 +1,10 @@ | |||
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 | + | }) |
更新
更早