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

This class defines the exact fields that are stored in the corresponding MongoDB documents. It should be used whenever database documents are being handled or read for the states collection.

Note that this class uses the generic Transferable trait to enable a toDTO() method on the model.

todo

Timestamp fields should be numbers to avoid timezone issues.

since

v0.2.0

Hierarchy

Index

Constructors

Properties

collectionName: string = "states"

This field contains the mongo collection name for entries that are stored using StateDocument or the model StateModel.

Note that this field is not part of document properties and used only internally to perform queries that refer to an individual collection name, e.g. $unionWith.

access

public

var

{string}

createdAt?: Date

The document's creation timestamp. This field does not reflect the date of creation of an account but rather the date of creation of the cached database entry.

This field is required and indexed.

access

public

readonly
var

{Date}

data: any

The state cache document's actual data. Note that this field is poorly typed and can contain any object, the reason for this is to be flexible about state caches for the beginning, in a later iteration of the framework it is possible that this field would be updated to a strictly typed alternative.

This field is required and indexed.

access

public

readonly
var

{StateData}

name: string

The state cache document's name. Note that this field must contain dynamic module names, e.g. "discovery" or `"payout", such that state cache for each individual module can be tracked accordingly.

This field is required, indexed and values are expected to be unique.

access

public

readonly
var

{string}

updatedAt?: Date

The document's update timestamp. This field does not reflect the date of update of an account but rather the date of update of the cached database entry.

This field is optional and not indexed.

access

public

readonly
var

{Date}

Accessors

  • get toQuery(): Record<string, unknown>
  • This method implements a specialized query format to query items individually, as documents, in the collection: states.

    access

    public

    Returns Record<string, unknown>

    The individual document data that is used in a query.

Methods

Generated using TypeDoc