Skip to content
On this page

Athena.systems.global

Interfaces

Functions

decrease

Usage

Athena.systems.global.decrease(key, decreaseByValue?, startValue?): Promise<boolean>

Decrease the value of a key in the document by a given value

Parameters

NameTypeDefault valueDescription
keystringundefinedThe key of the field you want to update.
decreaseByValue?number1The amount to decrease the value by.
startValuenumberundefinedThe value to start the counter at.

Returns

Promise<boolean>

Defined in

server/systems/global.ts:113


get

Usage

Athena.systems.global.get<IGlobal>(): Promise<IGlobal>

It fetches the singleton document from the database.

Type parameters

Name
IGlobal

Returns

Promise<IGlobal>

A promise of an IGlobal object.

Defined in

server/systems/global.ts:80


getKey

Usage

Athena.systems.global.getKey<T>(key): Promise<T>

get returns the value of the specified key from the specified document

Type parameters

Name
T

Parameters

NameTypeDescription
keystringThe key to fetch from the database.

Returns

Promise<T>

The value of the key.

Defined in

server/systems/global.ts:70


increase

Usage

Athena.systems.global.increase(key, increaseByValue?, startValue?): Promise<boolean>

Increase the value of a key in a document by a given value

Parameters

NameTypeDefault valueDescription
keystringundefinedThe key to increase.
increaseByValue?number1The amount to increase the value by.
startValue?number0The value to start the counter at.

Returns

Promise<boolean>

Defined in

server/systems/global.ts:90


isReady

Usage

Athena.systems.global.isReady(): Promise<boolean>

Checks if the Global document is ready for handling requests.

Returns

Promise<boolean>

The isReady function returns a Promise that resolves to true when the uid is defined.

Defined in

server/systems/global.ts:37


setKey

Usage

Athena.systems.global.setKey<T>(key, value): Promise<void>

It sets and overrides the value of the key in the database.

Type parameters

Name
T

Parameters

NameTypeDescription
keystringThe key to set.
valueTThe value to be set.

Returns

Promise<void>

Defined in

server/systems/global.ts:60

Created by Stuyk | Est. 2020