| 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>, |