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

Method countDocuments

packages/mongodb/src/MongoConnection.ts:374–386  ·  view source on GitHub ↗
(
    entityName: EntityName<T>,
    where: FilterQuery<T>,
    opts: MongoCountOptions = {},
  )

Source from the content-addressed store, hash-verified

372 }
373
374 async countDocuments<T extends object>(
375 entityName: EntityName<T>,
376 where: FilterQuery<T>,
377 opts: MongoCountOptions = {},
378 ): Promise<number> {
379 return this.runQuery<T, number>('countDocuments', entityName, undefined, where, opts.ctx, {
380 loggerContext: opts.loggerContext,
381 collation: opts.collation,
382 indexHint: opts.indexHint,
383 maxTimeMS: opts.maxTimeMS,
384 signal: opts.signal,
385 });
386 }
387
388 override async transactional<T>(
389 cb: (trx: Transaction<ClientSession>) => Promise<T>,

Callers 1

countMethod · 0.80

Calls 1

runQueryMethod · 0.95

Tested by

no test coverage detected