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 ​
Name | Type | Default value | Description |
---|---|---|---|
key | string | undefined | The key of the field you want to update. |
decreaseByValue? | number | 1 | The amount to decrease the value by. |
startValue | number | undefined | The value to start the counter at. |
Returns ​
Promise
<boolean
>
Defined in ​
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 ​
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 ​
Name | Type | Description |
---|---|---|
key | string | The key to fetch from the database. |
Returns ​
Promise
<T
>
The value of the key.
Defined in ​
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 ​
Name | Type | Default value | Description |
---|---|---|---|
key | string | undefined | The key to increase. |
increaseByValue? | number | 1 | The amount to increase the value by. |
startValue? | number | 0 | The value to start the counter at. |
Returns ​
Promise
<boolean
>
Defined in ​
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 ​
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 ​
Name | Type | Description |
---|---|---|
key | string | The key to set. |
value | T | The value to be set. |
Returns ​
Promise
<void
>