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, an error will be thrown.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value |
number |
<optional> |
1 | The value by which to decrement the document field. |
Returns:
(static) delete() → {ReactiveDb.UpdateOperator}
Builds a UpdateOperator that will delete the document field it applies to (if
existing).
Returns:
(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, an error will be thrown.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value |
number |
<optional> |
1 | The value by which to increment the document field. |
Returns:
(static) maximum(value) → {ReactiveDb.UpdateOperator}
Builds a UpdateOperator that will set the document field it applies to with
the given value if the current value is less than 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. The given value may be of any type, the comparison follows the same ordering as MongoDB.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
any | The minimum value of the document field. |
Returns:
(static) minimum(value) → {ReactiveDb.UpdateOperator}
Builds a UpdateOperator that will set the document field it applies to with
the given value if the current value is greater than 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. The given value may be of any type, the comparison follows the same ordering as MongoDB.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
any | The maximum value of the document field. |
Returns:
(static) multiply(value) → {ReactiveDb.UpdateOperator}
Builds a UpdateOperator that will multiply 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, an error will be thrown.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | The value by which to multiply the document field. |
Returns:
(static) serverTime() → {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:
(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. |