最後活躍 1729145384

修訂 bfc6dbce8771886399d50706cb12911345929e87

TypeORM-readme-26.ts 原始檔案
1import { Photo } from "./entity/Photo"
2import { AppDataSource } from "./index"
3
4const photoRepository = AppDataSource.getRepository(Photo)
5const photoToUpdate = await photoRepository.findOneBy({
6 id: 1,
7})
8photoToUpdate.name = "Me, my friends and polar bears"
9await photoRepository.save(photoToUpdate)