knox hat die Gist bearbeitet . Zu Änderung gehen
1 file changed, 9 insertions
TypeORM-readme-26.ts(Datei erstellt)
@@ -0,0 +1,9 @@ | |||
1 | + | import { Photo } from "./entity/Photo" | |
2 | + | import { AppDataSource } from "./index" | |
3 | + | ||
4 | + | const photoRepository = AppDataSource.getRepository(Photo) | |
5 | + | const photoToUpdate = await photoRepository.findOneBy({ | |
6 | + | id: 1, | |
7 | + | }) | |
8 | + | photoToUpdate.name = "Me, my friends and polar bears" | |
9 | + | await photoRepository.save(photoToUpdate) |
Neuer
Älter