Expand description
Field transforms (serverTimestamp, increment, maximum, minimum, arrayUnion,
arrayRemove).
Semantics as measured on the official emulator v1.22.0 (tools/oracle/transforms.py):
REQUEST_TIMEis the commit’s time truncated to milliseconds, the same for every field of the commit.increment: a missing or non-numeric field becomes the operand; two integers add with saturation ati64::MIN/i64::MAX; otherwise both are added as doubles.maximum/minimum: a missing or non-numeric field becomes the operand; equal values (3and3.0,-0.0and0.0) keep the stored value and its type; NaN on either side gives NaN.arrayUnionappends operand elements not already present;arrayRemoveremoves every element equal to an operand. Equality is Firestore value equality (1 == 1.0, NaN equals NaN, maps and arrays compare element-wise). A field that is not an array starts empty, soarrayRemoveon it leaves an empty array.- Transforms run after the write’s update, in order; several may target the same field, and a path through a non-map value replaces that value with a map.
Functions§
- apply
- Applies
transformtofieldsand returns its transform result. Errors are the officialINVALID_ARGUMENTmessages. - request_
time REQUEST_TIMEhas millisecond precision.