Class IntermediateDataOperation<T>
Type Parameters
- T extends JSONSerializable
The expected value type from this operation.
Methods
add
- add(value): IntermediateDataOperation<T>
Adds
value
to the current value of the key, if both the current value andvalue
are arrays thenvalue
will be appended to the current value.Parameters
- value: number | JSONSerializable[]
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number | JSONSerializable[]
and
- and(value): IntermediateDataOperation<T>
Applies a bitwise AND to the current value of the key with
value
.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
ceiling
- ceiling(): IntermediateDataOperation<T>
Rounds up the current value to the nearest integer.
Returns IntermediateDataOperation<T>
commit
- commit(awaitReply): Promise<T>
Commit the current operations to data store and return a Promise with the updated key, once fulfilled.
Parameters
- awaitReply: true
If
true
, a promise will be returned with the new value. Otherwise, immediately resolves.
Returns Promise<T>
- awaitReply: true
- commit(awaitReply?): Promise<void>
Commit the current operations to data store.
Parameters
Optional
awaitReply: false
Returns Promise<void>
default
- default(): IntermediateDataOperation<T>
If the key has no value yet, sets the current value of the key to
default
.Returns IntermediateDataOperation<T>
floor
- floor(): IntermediateDataOperation<T>
Rounds down the current value to the nearest integer.
Returns IntermediateDataOperation<T>
leftShift
- left
Shift (value): IntermediateDataOperation<T> Applies a bitwise left-shift to the current value of the key by
value
.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
max
- max(value): IntermediateDataOperation<T>
Sets the current value of the key to
value
ifvalue
is bigger.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
min
- min(value): IntermediateDataOperation<T>
Sets the current value of the key to
value
ifvalue
is bigger.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
multiply
- multiply(value): IntermediateDataOperation<T>
Multiplies the current value of the key by
value
.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
or
- or(value): IntermediateDataOperation<T>
Applies a bitwise OR to the current value of the key with value.
Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
pop
- pop(value): IntermediateDataOperation<T>
List or Dict only: for
lists
it will remove the index of thevalue
given. Fordicts
it removes the element with the specified key ofvalue
.Parameters
- value: JSONSerializable
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: JSONSerializable
power
- power(value): IntermediateDataOperation<T>
Multiplies the current value of the key to the power of
value
.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
remainder
- remainder(value): IntermediateDataOperation<T>
Sets the current value of the key to the remainder after division by
value
.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
remove
- remove(value): IntermediateDataOperation<T>
List only: removes the first instance of
value
found in the list.Parameters
- value: JSONSerializable
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: JSONSerializable
replace
- replace(value): IntermediateDataOperation<T>
Sets the current value of the key to
value
.Parameters
- value: JSONSerializable
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: JSONSerializable
rightShift
- right
Shift (value): IntermediateDataOperation<T> Applies a bitwise right-shift to the current value of the key by
value
.Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
update
- update(value): IntermediateDataOperation<T>
Dict only: Updates the dictionary with the specified elements given in
value
creating new keys, or updating old ones if they previously existed.Parameters
- value: JSONSerializable
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: JSONSerializable
xor
- xor(value): IntermediateDataOperation<T>
Applies a bitwise XOR to the current value of the key with value.
Parameters
- value: number
A value for the operation to apply against the current data storage value.
Returns IntermediateDataOperation<T>
- value: number
An intermediate abstract object holding an array of data storage operations to be performed in order by the server.