method IMongoCollection.countDocuments
IMongoCollection.countDocuments(
filter: Record<string, unknown>,
): Promise<number>

Counts matching documents.

Parameters

filter: Record<string, unknown>

The match filter

optional
options: MongoWriteOptions

The operation options (e.g. a session)

Return Type

Promise<number>

The matching count

Usage

import { type IMongoCollection } from "database-plugin/src/index.ts";