MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / update

Method update

packages/sql/src/query/QueryBuilder.ts:932–934  ·  view source on GitHub ↗

* Creates an UPDATE query with the given data. * Use `where()` to specify which rows to update. * * @example * ```ts * await em.createQueryBuilder(User) * .update({ name: 'John Doe' }) * .where({ id: 1 }) * .execute(); * ```

(data: EntityData<Entity>)

Source from the content-addressed store, hash-verified

930 * ```
931 */
932 update(data: EntityData<Entity>): UpdateQueryBuilder<Entity, RootAlias, Context> {
933 return this.init(QueryType.UPDATE, data) as unknown as UpdateQueryBuilder<Entity, RootAlias, Context>;
934 }
935
936 /**
937 * Creates a DELETE query.

Callers

nothing calls this directly

Calls 1

initMethod · 0.95

Tested by

no test coverage detected