(
entityName: EntityName<T>,
where: FilterQuery<T>,
options: CountOptions<T> = {},
)
| 299 | } |
| 300 | |
| 301 | async count<T extends object>( |
| 302 | entityName: EntityName<T>, |
| 303 | where: FilterQuery<T>, |
| 304 | options: CountOptions<T> = {}, |
| 305 | ): Promise<number> { |
| 306 | /* v8 ignore next */ |
| 307 | if (this.metadata.find(entityName)?.virtual) { |
| 308 | return this.countVirtual(entityName, where, options); |
| 309 | } |
| 310 | |
| 311 | where = this.renameFields(entityName, where as T, true); |
| 312 | const queryOpts = this.buildQueryOptions(options); |
| 313 | return this.rethrow( |
| 314 | this.getConnection('read').countDocuments(entityName, where as object, { |
| 315 | ctx: options.ctx, |
| 316 | loggerContext: options.logging, |
| 317 | ...queryOpts, |
| 318 | }), |
| 319 | ); |
| 320 | } |
| 321 | |
| 322 | async nativeInsert<T extends object>( |
| 323 | entityName: EntityName<T>, |
nothing calls this directly
no test coverage detected