Options
All
  • Public
  • Public/Protected
  • All
Menu
description

The main service of the Leaderboards module.

since

v0.5.0

Hierarchy

  • StatisticsService

Index

Constructors

Methods

  • This method executes a count query using the {@link model} argument.

    Caution: Count queries require a considerable amount of RAM to execute. It is preferred to use pro-active statistics with collections that contain one document with a counter.

    access

    public

    async

    Parameters

    Returns Promise<number>

    The number of matching transactions.

  • This method creates or updates a document in the statistics collection.

    access

    public

    async

    Parameters

    • query: StatisticsQuery

      The query configuration with sort, order, pageNumber, pageSize.

    • data: StatisticsModel

      The fields or data that has to be updated (will be added to $set: {}).

    • ops: Record<string, any> = {}

      The operations that must be run additionally (e.g. $inc: {}) (optional).

    Returns Promise<StatisticsDocument>

    The updated transactions document.

  • Method to query the existence of a document in the statistics collection.

    This executes a lean mongoose query such that the properties of the returned document are reduced to only the "_id" field.

    access

    public

    async

    Parameters

    • query: StatisticsQuery

      The query configuration with sort, order, pageNumber, pageSize.

    Returns Promise<boolean>

    Whether a document exists which validates the passed query.

Generated using TypeDoc