mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
426 B
426 B
Update using Query Builder
You can create UPDATE queries using QueryBuilder.
Examples:
import {getConnection} from "typeorm";
await getConnection()
.createQueryBuilder()
.update(User)
.set({ firstName: "Timber", lastName: "Saw" })
.where("id = :id", { id: 1 })
.execute();
This is the most efficient way in terms of performance to update entities in your database.