Class: UpdateOperator

ReactiveDb.UpdateOperator

Represents an update operator to a apply on a document field. Instances of this class are expected to occur within Update descriptors.

Instances of update operators are built using the provided static factories, which can be accessed using the UpdateOperator property of the Webcom.ReactiveDb static property.

Methods

(static) decrement(valueopt) → {ReactiveDb.UpdateOperator}

Builds a UpdateOperator that will decrement the document field it applies to by the given value.

When the update operation is performed, if the document field doesn't exist, it is created and initialized with the given value. If the document field exists but has not a numeric value, it is overwritten with the given value.

Parameters:
Name Type Attributes Default Description
value number <optional>
1

The value by which to decrement the document field.
Negative values are accepted, they result in incrementing the field.

Returns:
Type
ReactiveDb.UpdateOperator

(static) delete() → {ReactiveDb.UpdateOperator}

Builds a UpdateOperator that will delete the document field it applies to (if existing).

Returns:
Type
ReactiveDb.UpdateOperator

(static) increment(valueopt) → {ReactiveDb.UpdateOperator}

Builds a UpdateOperator that will increment the document field it applies to by the given value.

When the update operation is performed, if the document field doesn't exist, it is created and initialized with the given value. If the document field exists but has not a numeric value, it is overwritten with the given value.

Parameters:
Name Type Attributes Default Description
value number <optional>
1

The value by which to increment the document field.
Negative values are accepted, they result in decrementing the field.

Returns:
Type
ReactiveDb.UpdateOperator

(static) serverDate() → {ReactiveDb.UpdateOperator}

Builds a UpdateOperator that will set (create or overwrite) the document field it applies to with the timestamp of the server clock when the update operation will be performed.

Returns:
Type
ReactiveDb.UpdateOperator

(static) set(value) → {ReactiveDb.UpdateOperator}

Builds a UpdateOperator that will set (create or overwrite) the document field it applies to with the given value.

Parameters:
Name Type Description
value ReactiveDb.DocumentData

The value of the document field to set.

Returns:
Type
ReactiveDb.UpdateOperator
deprecated
Authentication
ServerlessDb
ReactiveDb