Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MongoDatabaseStatisticProviderBase<TDatabase>

A basic statistic provider that loads data from Mongo database.

Type parameters

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly database

database: TDatabase

The underlying database connection.

Methods

close

  • close(): Promise<void>

Protected countDocuments

  • countDocuments<TDocument>(modelSelector: (db: TDatabase) => Model<TDocument>, filter?: any): Promise<number>
  • Counts all documents of a collection.

    Type parameters

    • TDocument: Document

    Parameters

    • modelSelector: (db: TDatabase) => Model<TDocument>

      The function that returns the model to use.

        • (db: TDatabase): Model<TDocument>
        • Parameters

          • db: TDatabase

          Returns Model<TDocument>

    • Optional filter: any

    Returns Promise<number>

    The promise that contains the number of documents.

load

Protected Abstract loadInner

Generated using TypeDoc