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

Method delete

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

* Creates a DELETE query. * Use `where()` to specify which rows to delete. * * @example * ```ts * await em.createQueryBuilder(User) * .delete() * .where({ id: 1 }) * .execute(); * * // Or pass the condition directly * await em.createQueryBuilder(User) * .d

(cond?: QBFilterQuery<Entity, RootAlias, Context, RawAliases>)

Source from the content-addressed store, hash-verified

951 * ```
952 */
953 delete(cond?: QBFilterQuery<Entity, RootAlias, Context, RawAliases>): DeleteQueryBuilder<Entity, RootAlias, Context> {
954 return this.init(QueryType.DELETE, undefined, cond) as unknown as DeleteQueryBuilder<Entity, RootAlias, Context>;
955 }
956
957 /**
958 * Creates a TRUNCATE query to remove all rows from the table.

Callers

nothing calls this directly

Calls 1

initMethod · 0.95

Tested by

no test coverage detected