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

Method nativeDelete

packages/mongodb/src/MongoDriver.ts:499–513  ·  view source on GitHub ↗
(
    entityName: EntityName<T>,
    where: FilterQuery<T>,
    options: { ctx?: Transaction<ClientSession>; signal?: AbortSignal } = {},
  )

Source from the content-addressed store, hash-verified

497 }
498
499 async nativeDelete<T extends object>(
500 entityName: EntityName<T>,
501 where: FilterQuery<T>,
502 options: { ctx?: Transaction<ClientSession>; signal?: AbortSignal } = {},
503 ): Promise<QueryResult<T>> {
504 if (Utils.isPrimaryKey(where)) {
505 where = this.buildFilterById(entityName, where as string);
506 }
507
508 where = this.renameFields(entityName, where as T, true);
509
510 return this.rethrow(
511 this.getConnection('write').deleteMany(entityName, where as object, options.ctx, options.signal),
512 ) as unknown as Promise<QueryResult<T>>;
513 }
514
515 override async aggregate(
516 entityName: EntityName,

Callers

nothing calls this directly

Calls 6

buildFilterByIdMethod · 0.95
renameFieldsMethod · 0.95
isPrimaryKeyMethod · 0.80
rethrowMethod · 0.80
deleteManyMethod · 0.80
getConnectionMethod · 0.65

Tested by

no test coverage detected