> Documentation index: https://firebase.google.com/docs/reference/llms.txt

# Field


```
public final class Field extends Selectable
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/kotlin/java/lang/Object.html) ||||
| ↳ | [com.google.firebase.firestore.pipeline.Expression](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/pipeline/Expression.md.txt) |||
|   | ↳ | [com.google.firebase.firestore.pipeline.Selectable](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/pipeline/Selectable.md.txt) ||
|   |   | ↳ | [com.google.firebase.firestore.pipeline.Field](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/pipeline/Field.md.txt) |

*** ** * ** ***

Represents a reference to a field in a Firestore document.

`Field` references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.

You can create a `Field` instance using the static `Expression.field` method:

## Summary

| ### Nested types |
|---|
| `public static class Field.Companion` |

| ### Public methods |
|---|---|
| `boolean` | `equals(Object other)` |
| `final @NonNull Expression` | `geoDistance(@NonNull GeoPoint location)` Evaluates to the distance in meters between the location specified by this field and the query location. |
| `int` | `hashCode()` |

### Inherited methods

From [com.google.firebase.firestore.pipeline.Expression](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/pipeline/Expression.md.txt) `final @NonNull Expression` `abs()`

Creates an expression that returns the absolute value of this expression.
`final @NonNull Expression` `add(@NonNull Expression second)`

Creates an expression that adds this numeric expression to another numeric expression.
`final @NonNull Expression` `add(@NonNull Number second)`

Creates an expression that adds this numeric expression to a constants.
`@NonNull AliasedExpression` `alias(@NonNull String alias)`

Assigns an alias to this expression.
`final @NonNull AggregateFunction` `arrayAgg()`

Creates an aggregation that collects all values of this expression across multiple stage inputs into an array.
`final @NonNull AggregateFunction` `arrayAggDistinct()`

Creates an aggregation that collects all distinct values of this expression across multiple stage inputs into an array.
`final @NonNull Expression` `arrayConcat(@NonNull Object secondArray, @NonNull Object otherArrays)`

Creates an expression that concatenates a field's array value with other arrays.
`final @NonNull Expression` `arrayConcat(@NonNull Expression secondArray, @NonNull Object otherArrays)`

Creates an expression that concatenates a field's array value with other arrays.
`final @NonNull BooleanExpression` `arrayContains(@NonNull Object element)`

Creates an expression that checks if array contains a specific `element`.
`final @NonNull BooleanExpression` `arrayContains(@NonNull Expression element)`

Creates an expression that checks if array contains a specific `element`.
`final @NonNull BooleanExpression` `arrayContainsAll(@NonNull Expression arrayExpression)`

Creates an expression that checks if array contains all elements of `arrayExpression`.
`final @NonNull BooleanExpression` `arrayContainsAll(@NonNull List<@NonNull Object> values)`

Creates an expression that checks if array contains all the specified `values`.
`final @NonNull BooleanExpression` `arrayContainsAny(@NonNull Expression arrayExpression)`

Creates an expression that checks if array contains any elements of `arrayExpression`.
`final @NonNull BooleanExpression` `arrayContainsAny(@NonNull List<@NonNull Object> values)`

Creates an expression that checks if array contains any of the specified `values`.
`final @NonNull Expression` `arrayFilter(@NonNull String alias, @NonNull BooleanExpression filter)`

Filters this array expression based on a predicate.
`final @NonNull Expression` `arrayFirst()`

Creates an expression that returns the first element of an array expression.
`final @NonNull Expression` `arrayFirstN(@NonNull Expression n)`

Creates an expression that returns the first N elements of an array expression.
`final @NonNull Expression` `arrayFirstN(int n)`

Creates an expression that returns the first N elements of an array expression.
`final @NonNull Expression` `arrayGet(@NonNull Expression offset)`

Creates an expression that indexes into an array from the beginning or end and return the element.
`final @NonNull Expression` `arrayGet(int offset)`

Creates an expression that indexes into an array from the beginning or end and return the element.
`final @NonNull Expression` `arrayIndexOf(Object value)`

Creates an expression that returns the first index where the specified `value` occurs in the `array`.
`final @NonNull Expression` `arrayIndexOfAll(Object value)`

Creates an expression that returns a list of all indices where the specified `value` occurs in the `array`.
`final @NonNull Expression` `arrayLast()`

Creates an expression that returns the last element of an array expression.
`final @NonNull Expression` `arrayLastIndexOf(Object value)`

Creates an expression that returns the last index where the specified `value` occurs in the `array`.
`final @NonNull Expression` `arrayLastN(@NonNull Expression n)`

Creates an expression that returns the last N elements of an array expression.
`final @NonNull Expression` `arrayLastN(int n)`

Creates an expression that returns the last N elements of an array expression.
`final @NonNull Expression` `arrayLength()`

Creates an expression that calculates the length of an array expression.
`final @NonNull Expression` `arrayMaximum()`

Creates an expression that returns the maximum value of an array expression.
`final @NonNull Expression` `arrayMaximumN(@NonNull Expression n)`

Creates an expression that returns the first `n` largest elements of the `array`.
`final @NonNull Expression` `arrayMaximumN(int n)`

Creates an expression that returns the first `n` largest elements of the `array`.
`final @NonNull Expression` `arrayMinimum()`

Creates an expression that returns the minimum value of an array expression.
`final @NonNull Expression` `arrayMinimumN(@NonNull Expression n)`

Creates an expression that returns the first `n` smallest elements of the `array`.
`final @NonNull Expression` `arrayMinimumN(int n)`

Creates an expression that returns the first `n` smallest elements of the `array`.
`final @NonNull Expression` `arrayReverse()`

Reverses the order of elements in the array.
`final @NonNull Expression` `arraySlice(@NonNull Expression offset, @NonNull Expression length)`

Creates an expression that returns a slice of this array expression.
`final @NonNull Expression` `arraySlice(int offset, int length)`

Creates an expression that returns a slice of this array expression.
`final @NonNull Expression` `arraySliceToEnd(@NonNull Expression offset)`

Creates an expression that returns a slice of this array expression to its end.
`final @NonNull Expression` `arraySliceToEnd(int offset)`

Creates an expression that returns a slice of this array expression to its end.
`final @NonNull Expression` `arraySum()`

Creates an expression that returns the sum of the elements in this array expression.
`final @NonNull Expression` `arrayTransform(@NonNull String elementAlias, @NonNull Expression transform)`

Creates an expression that applies a provided transformation to each element in an array.
`final @NonNull Expression` `arrayTransformWithIndex(
@NonNull String elementAlias,
@NonNull String indexAlias,
@NonNull Expression transform
)`

Creates an expression that applies a provided transformation to each element in an array, providing the element's index to the transformation expression.
`final @NonNull BooleanExpression` `asBoolean()`

Casts the expression to a `BooleanExpression`.
`final @NonNull Ordering` `ascending()`

Create an `Ordering` that sorts documents in ascending order based on value of this expression
`final @NonNull AggregateFunction` `average()`

Creates an aggregation that calculates the average (mean) of this numeric expression across multiple stage inputs.
`final @NonNull Expression` `bitAnd(@NonNull byte[] bitsOther)`

Creates an expression that applies a bitwise AND operation with a constant.
`final @NonNull Expression` `bitAnd(@NonNull Expression bitsOther)`

Creates an expression that applies a bitwise AND operation with other expression.
`final @NonNull Expression` `bitLeftShift(int number)`

Creates an expression that applies a bitwise left shift operation with a constant.
`final @NonNull Expression` `bitLeftShift(@NonNull Expression numberExpr)`

Creates an expression that applies a bitwise left shift operation with an expression.
`final @NonNull Expression` `bitNot()`

Creates an expression that applies a bitwise NOT operation to this expression.
`final @NonNull Expression` `bitOr(@NonNull byte[] bitsOther)`

Creates an expression that applies a bitwise OR operation with a constant.
`final @NonNull Expression` `bitOr(@NonNull Expression bitsOther)`

Creates an expression that applies a bitwise OR operation with other expression.
`final @NonNull Expression` `bitRightShift(int number)`

Creates an expression that applies a bitwise right shift operation with a constant.
`final @NonNull Expression` `bitRightShift(@NonNull Expression numberExpr)`

Creates an expression that applies a bitwise right shift operation with an expression.
`final @NonNull Expression` `bitXor(@NonNull byte[] bitsOther)`

Creates an expression that applies a bitwise XOR operation with a constant.
`final @NonNull Expression` `bitXor(@NonNull Expression bitsOther)`

Creates an expression that applies a bitwise XOR operation with an expression.
`final @NonNull Expression` `byteLength()`

Creates an expression that calculates the length of a string in UTF-8 bytes, or just the length of a Blob.
`final @NonNull Expression` `ceil()`

Creates an expression that returns the smallest integer that isn't less than this numeric expression.
`final @NonNull Expression` `charLength()`

Creates an expression that calculates the character length of this string expression in UTF8.
`final @NonNull Expression` `coalesce(@NonNull Object replacement, @NonNull Object others)`

Creates an expression that returns the first non-null, non-absent argument, without evaluating the rest of the arguments.
`final @NonNull Expression` `collectionId()`

Creates an expression that returns the collection ID from this path expression.
`final @NonNull Expression` `concat(@NonNull Object second, @NonNull Object others)`

Creates an expression that concatenates this expression's value with others.
`final @NonNull Expression` `concat(@NonNull Expression second, @NonNull Object others)`

Creates an expression that concatenates this expression's value with others.
`final @NonNull Expression` `cosineDistance(@NonNull double[] vector)`

Calculates the Cosine distance between this vector expression and a vector literal.
`final @NonNull Expression` `cosineDistance(@NonNull Expression vector)`

Calculates the Cosine distance between this and another vector expressions.
`final @NonNull Expression` `cosineDistance(@NonNull VectorValue vector)`

Calculates the Cosine distance between this vector expression and a vector literal.
`final @NonNull AggregateFunction` `count()`

Creates an aggregation that counts the number of stage inputs with valid evaluations of the this expression.
`final @NonNull AggregateFunction` `countDistinct()`

Creates an aggregation that counts the number of distinct values of an expression across multiple stage inputs.
`final @NonNull Ordering` `descending()`

Create an `Ordering` that sorts documents in descending order based on value of this expression
`final @NonNull Expression` `divide(@NonNull Expression divisor)`

Creates an expression that divides this numeric expression by another numeric expression.
`final @NonNull Expression` `divide(@NonNull Number divisor)`

Creates an expression that divides this numeric expression by a constant.
`final @NonNull Expression` `documentId()`

Creates an expression that returns the document ID from this path expression.
`final @NonNull Expression` `dotProduct(@NonNull double[] vector)`

Calculates the dot product distance between this vector expression and a vector literal.
`final @NonNull Expression` `dotProduct(@NonNull Expression vector)`

Calculates the dot product distance between this and another vector expression.
`final @NonNull Expression` `dotProduct(@NonNull VectorValue vector)`

Calculates the dot product distance between this vector expression and a vector literal.
`final @NonNull BooleanExpression` `endsWith(@NonNull Expression suffix)`

Creates an expression that checks if this string expression ends with a given `suffix`.
`final @NonNull BooleanExpression` `endsWith(@NonNull String suffix)`

Creates an expression that checks if this string expression ends with a given `suffix`.
`final @NonNull BooleanExpression` `equal(@NonNull Expression other)`

Creates an expression that checks if this and `other` expression are equal.
`final @NonNull BooleanExpression` `equal(@NonNull Object value)`

Creates an expression that checks if this expression is equal to a `value`.
`final @NonNull BooleanExpression` `equalAny(@NonNull Expression arrayExpression)`

Creates an expression that checks if this expression, when evaluated, is equal to any of the elements of `arrayExpression`.
`final @NonNull BooleanExpression` `equalAny(@NonNull List<@NonNull Object> values)`

Creates an expression that checks if this expression, when evaluated, is equal to any of the provided `values`.
`final @NonNull Expression` `euclideanDistance(@NonNull double[] vector)`

Calculates the Euclidean distance between this vector expression and a vector literal.
`final @NonNull Expression` `euclideanDistance(@NonNull Expression vector)`

Calculates the Euclidean distance between this and another vector expression.
`final @NonNull Expression` `euclideanDistance(@NonNull VectorValue vector)`

Calculates the Euclidean distance between this vector expression and a vector literal.
`final @NonNull BooleanExpression` `exists()`

Creates an expression that checks if this expression evaluates to a name of the field that exists.
`final @NonNull Expression` `exp()`

Creates an expression that returns Euler's number e raised to the power of this expression.
`final @NonNull AggregateFunction` `first()`

Creates an aggregation that finds the first value of this expression across multiple stage inputs.
`final @NonNull Expression` `floor()`

Creates an expression that returns the largest integer that is not greater than this numeric expression.
`final @NonNull Expression` `getField(@NonNull String key)`

Accesses a field/property of a document or Map using the provided `key`.
`final @NonNull Expression` `getField(@NonNull Expression keyExpression)`

Accesses a field/property of a document or Map using the provided `keyExpression`.
`final @NonNull BooleanExpression` `greaterThan(@NonNull Expression other)`

Creates an expression that checks if this expression is greater than the `other` expression.
`final @NonNull BooleanExpression` `greaterThan(@NonNull Object value)`

Creates an expression that checks if this expression is greater than a `value`.
`final @NonNull BooleanExpression` `greaterThanOrEqual(@NonNull Expression other)`

Creates an expression that checks if this expression is greater than or equal to the `other` expression.
`final @NonNull BooleanExpression` `greaterThanOrEqual(@NonNull Object value)`

Creates an expression that checks if this expression is greater than or equal to a `value`.
`final @NonNull Expression` `ifAbsent(@NonNull Expression elseExpr)`

Creates an expression that returns the `elseExpr` argument if this expression is absent, else return the result of this expression.
`final @NonNull Expression` `ifAbsent(@NonNull Object elseValue)`

Creates an expression that returns the `elseValue` argument if this expression is absent, else return the result of this expression.
`final @NonNull Expression` `ifError(@NonNull Expression catchExpr)`

Creates an expression that returns the `catchExpr` argument if there is an error, else return the result of this expression.
`final @NonNull Expression` `ifError(@NonNull Object catchValue)`

Creates an expression that returns the `catchValue` argument if there is an error, else return the result of this expression.
`final @NonNull Expression` `ifNull(@NonNull Expression elseExpression)`

Creates an expression that returns the `elseExpression` argument if this expression evaluates to null, else return the result of this expression.
`final @NonNull Expression` `ifNull(@NonNull Object elseValue)`

Creates an expression that returns the `elseValue` argument if this expression evaluates to null, else return the result of this expression.
`final @NonNull BooleanExpression` `isAbsent()`

Creates an expression that returns true if the result of this expression is absent.
`final @NonNull BooleanExpression` `isError()`

Creates an expression that checks if this expression produces an error.
`final @NonNull BooleanExpression` `isType(@NonNull String type)`

Creates an expression that checks if the result of this expression is of the given type.
`final @NonNull Expression` `join(@NonNull String delimiter)`

Creates an expression that joins the elements of an array into a string.
`final @NonNull Expression` `join(@NonNull Expression delimiterExpression)`

Creates an expression that joins the elements of an array into a string.
`final @NonNull AggregateFunction` `last()`

Creates an aggregation that finds the last value of this expression across multiple stage inputs.
`final @NonNull Expression` `length()`

Creates an expression that calculates the length of a string, array, map, vector, or blob expression.
`final @NonNull BooleanExpression` `lessThan(@NonNull Expression other)`

Creates an expression that checks if this expression is less than the `other` expression.
`final @NonNull BooleanExpression` `lessThan(@NonNull Object value)`

Creates an expression that checks if this expression is less than a value.
`final @NonNull BooleanExpression` `lessThanOrEqual(@NonNull Expression other)`

Creates an expression that checks if this expression is less than or equal to the `other` expression.
`final @NonNull BooleanExpression` `lessThanOrEqual(@NonNull Object value)`

Creates an expression that checks if this expression is less than or equal to a `value`.
`final @NonNull BooleanExpression` `like(@NonNull Expression pattern)`

Creates an expression that performs a case-sensitive wildcard string comparison.
`final @NonNull BooleanExpression` `like(@NonNull String pattern)`

Creates an expression that performs a case-sensitive wildcard string comparison.
`final @NonNull Expression` `ln()`

Creates an expression that returns the natural logarithm of this numeric expression.
`final @NonNull Expression` `log10()`

Creates an expression that returns the base-10 logarithm of this numeric expression.
`final @NonNull Expression` `logicalMaximum(@NonNull Object others)`

Creates an expression that returns the largest value between multiple input expressions or literal values.
`final @NonNull Expression` `logicalMaximum(@NonNull Expression others)`

Creates an expression that returns the largest value between multiple input expressions or literal values.
`final @NonNull Expression` `logicalMinimum(@NonNull Object others)`

Creates an expression that returns the smallest value between multiple input expressions or literal values.
`final @NonNull Expression` `logicalMinimum(@NonNull Expression others)`

Creates an expression that returns the smallest value between multiple input expressions or literal values.
`final @NonNull Expression` `ltrim()`

Creates an expression that removes leading whitespace from this string expression.
`final @NonNull Expression` `ltrimValue(@NonNull Expression valuesToTrim)`

Creates an expression that removes a set of leading values from this string expression.
`final @NonNull Expression` `ltrimValue(@NonNull String valuesToTrim)`

Creates an expression that removes a set of leading values from this string expression.
`final @NonNull Expression` `mapEntries()`

Creates an expression that returns the entries of this map expression as an array of maps, where each map contains a "k" property for the key and a "v" property for the value.
`final @NonNull Expression` `mapGet(@NonNull String key)`

Accesses a map (object) value using the provided `key`.
`final @NonNull Expression` `mapGet(@NonNull Expression keyExpression)`

Accesses a map (object) value using the provided `keyExpression`.
`final @NonNull Expression` `mapKeys()`

Creates an expression that returns the keys of this map expression.
`final @NonNull Expression` `mapMerge(@NonNull Expression mapExpr, @NonNull Expression otherMaps)`

Creates an expression that merges multiple maps into a single map.
`final @NonNull Expression` `mapRemove(@NonNull String key)`

Creates an expression that removes a key from this map expression.
`final @NonNull Expression` `mapRemove(@NonNull Expression keyExpression)`

Creates an expression that removes a key from this map expression.
`final @NonNull Expression` `mapSet(
@NonNull Expression key,
@NonNull Expression value,
@NonNull Expression moreKeyValues
)`

Creates an expression that returns a new map with the specified entries added or updated.
`final @NonNull Expression` `mapSet(@NonNull String key, Object value, @NonNull Object moreKeyValues)`

Creates an expression that returns a new map with the specified entries added or updated.
`final @NonNull Expression` `mapValues()`

Creates an expression that returns the values of this map expression.
`final @NonNull AggregateFunction` `maximum()`

Creates an aggregation that finds the maximum value of this expression across multiple stage inputs.
`final @NonNull AggregateFunction` `minimum()`

Creates an aggregation that finds the minimum value of this expression across multiple stage inputs.
`final @NonNull Expression` `mod(@NonNull Expression divisor)`

Creates an expression that calculates the modulo (remainder) of dividing this numeric expressions by another numeric expression.
`final @NonNull Expression` `mod(@NonNull Number divisor)`

Creates an expression that calculates the modulo (remainder) of dividing this numeric expressions by a constant.
`final @NonNull Expression` `multiply(@NonNull Expression second)`

Creates an expression that multiplies this numeric expression with another numeric expression.
`final @NonNull Expression` `multiply(@NonNull Number second)`

Creates an expression that multiplies this numeric expression with a constant.
`final @NonNull BooleanExpression` `notEqual(@NonNull Expression other)`

Creates an expression that checks if this expressions is not equal to the `other` expression.
`final @NonNull BooleanExpression` `notEqual(@NonNull Object value)`

Creates an expression that checks if this expression is not equal to a `value`.
`final @NonNull BooleanExpression` `notEqualAny(@NonNull Expression arrayExpression)`

Creates an expression that checks if this expression, when evaluated, is not equal to all the elements of `arrayExpression`.
`final @NonNull BooleanExpression` `notEqualAny(@NonNull List<@NonNull Object> values)`

Creates an expression that checks if this expression, when evaluated, is not equal to all the provided `values`.
`final @NonNull Expression` `parent()`

Creates an expression that returns the parent document reference of this document reference expression.
`final @NonNull Expression` `pow(@NonNull Expression exponent)`

Creates an expression that returns this numeric expression raised to the power of the `exponent`.
`final @NonNull Expression` `pow(@NonNull Number exponent)`

Creates an expression that returns this numeric expression raised to the power of the `exponent`.
`final @NonNull BooleanExpression` `regexContains(@NonNull Expression pattern)`

Creates an expression that checks if this string expression contains a specified regular expression as a substring.
`final @NonNull BooleanExpression` `regexContains(@NonNull String pattern)`

Creates an expression that checks if this string expression contains a specified regular expression as a substring.
`final @NonNull BooleanExpression` `regexMatch(@NonNull Expression pattern)`

Creates an expression that checks if this string expression matches a specified regular expression.
`final @NonNull BooleanExpression` `regexMatch(@NonNull String pattern)`

Creates an expression that checks if this string expression matches a specified regular expression.
`final @NonNull Expression` `reverse()`

Creates an expression that reverses this string expression.
`final @NonNull Expression` `round()`

Creates an expression that rounds this numeric expression to nearest integer.
`final @NonNull Expression` `roundToPrecision(@NonNull Expression decimalPlace)`

Creates an expression that rounds off this numeric expression to `decimalPlace` decimal places if `decimalPlace` is positive, rounds off digits to the left of the decimal point if `decimalPlace` is negative.
`final @NonNull Expression` `roundToPrecision(int decimalPlace)`

Creates an expression that rounds off this numeric expression to `decimalPlace` decimal places if `decimalPlace` is positive, rounds off digits to the left of the decimal point if `decimalPlace` is negative.
`final @NonNull Expression` `rtrim()`

Creates an expression that removes trailing whitespace from this string expression.
`final @NonNull Expression` `rtrimValue(@NonNull Expression valuesToTrim)`

Creates an expression that removes a set of trailing values from this string expression.
`final @NonNull Expression` `rtrimValue(@NonNull String valuesToTrim)`

Creates an expression that removes a set of trailing characters from this string expression.
`final @NonNull Expression` `split(@NonNull Blob delimiter)`

Creates an expression that splits this blob expression by a blob delimiter.
`final @NonNull Expression` `split(@NonNull Expression delimiter)`

Creates an expression that splits this string or blob expression by a delimiter.
`final @NonNull Expression` `split(@NonNull String delimiter)`

Creates an expression that splits this string or blob expression by a string delimiter.
`final @NonNull Expression` `sqrt()`

Creates an expression that returns the square root of this numeric expression.
`final @NonNull BooleanExpression` `startsWith(@NonNull Expression prefix)`

Creates an expression that checks if this string expression starts with a given `prefix`.
`final @NonNull BooleanExpression` `startsWith(@NonNull String prefix)`

Creates an expression that checks if this string expression starts with a given `prefix`.
`final @NonNull Expression` `stringConcat(@NonNull Expression stringExpressions)`

Creates an expression that concatenates string expressions together.
`final @NonNull Expression` `stringConcat(@NonNull Object strings)`

Creates an expression that concatenates string expressions and string constants together.
`final @NonNull Expression` `stringConcat(@NonNull String strings)`

Creates an expression that concatenates this string expression with string constants.
`final @NonNull BooleanExpression` `stringContains(@NonNull Expression substring)`

Creates an expression that checks if this string expression contains a specified substring.
`final @NonNull BooleanExpression` `stringContains(@NonNull String substring)`

Creates an expression that checks if this string expression contains a specified substring.
`final @NonNull Expression` `stringIndexOf(@NonNull Expression substring)`

Creates an expression that returns the 0-based index of the first occurrence of the specified substring.
`final @NonNull Expression` `stringIndexOf(@NonNull String substring)`

Creates an expression that returns the 0-based index of the first occurrence of the specified substring.
`final @NonNull Expression` `stringRepeat(@NonNull Expression count)`

Creates an expression that repeats this string expression a given number of times.
`final @NonNull Expression` `stringRepeat(int count)`

Creates an expression that repeats this string expression a given number of times.
`final @NonNull Expression` `stringReplaceAll(
@NonNull Expression oldValue,
@NonNull Expression newValue
)`

Creates an expression that replaces all occurrences of a substring with another string.
`final @NonNull Expression` `stringReplaceAll(@NonNull String oldValue, @NonNull String newValue)`

Creates an expression that replaces all occurrences of a substring with another string.
`final @NonNull Expression` `stringReplaceOne(
@NonNull Expression oldValue,
@NonNull Expression newValue
)`

Creates an expression that replaces the first occurrence of a substring with another string.
`final @NonNull Expression` `stringReplaceOne(@NonNull String oldValue, @NonNull String newValue)`

Creates an expression that replaces the first occurrence of a substring with another string.
`final @NonNull Expression` `stringReverse()`

Creates an expression that performs a reverse operation on this string expression.
`final @NonNull Expression` `substring(@NonNull Expression start, @NonNull Expression length)`

Creates an expression that returns a substring of the given string.
`final @NonNull Expression` `substring(int start, int length)`

Creates an expression that returns a substring of the given string.
`final @NonNull Expression` `subtract(@NonNull Expression subtrahend)`

Creates an expression that subtracts a constant from this numeric expression.
`final @NonNull Expression` `subtract(@NonNull Number subtrahend)`

Creates an expression that subtracts a numeric expressions from this numeric expression.
`final @NonNull AggregateFunction` `sum()`

Creates an aggregation that calculates the sum of this numeric expression across multiple stage inputs.
`final @NonNull Expression` `timestampAdd(@NonNull Expression unit, @NonNull Expression amount)`

Creates an expression that adds a specified amount of time to this timestamp expression.
`final @NonNull Expression` `timestampAdd(@NonNull String unit, long amount)`

Creates an expression that adds a specified amount of time to this timestamp expression.
`final @NonNull Expression` `timestampDiff(@NonNull Expression start, @NonNull Expression unit)`

Calculates the difference between this timestamp and another timestamp.
`final @NonNull Expression` `timestampDiff(@NonNull Expression start, @NonNull String unit)`

Calculates the difference between this timestamp and another timestamp.
`final @NonNull Expression` `timestampDiff(@NonNull String startFieldName, @NonNull String unit)`

Calculates the difference between this timestamp and another timestamp.
`final @NonNull Expression` `timestampExtract(@NonNull Expression part)`

Creates an expression that extracts a specified part from this timestamp expression.
`final @NonNull Expression` `timestampExtract(@NonNull String part)`

Creates an expression that extracts a specified part from this timestamp expression.
`final @NonNull Expression` `timestampExtractWithTimezone(
@NonNull Expression part,
@NonNull Expression timezone
)`

Creates an expression that extracts a specified part from this timestamp expression in a given timezone.
`final @NonNull Expression` `timestampExtractWithTimezone(
@NonNull Expression part,
@NonNull String timezone
)`

Creates an expression that extracts a specified part from this timestamp expression in a given timezone.
`final @NonNull Expression` `timestampExtractWithTimezone(
@NonNull String part,
@NonNull Expression timezone
)`

Creates an expression that extracts a specified part from this timestamp expression in a given timezone.
`final @NonNull Expression` `timestampExtractWithTimezone(
@NonNull String part,
@NonNull String timezone
)`

Creates an expression that extracts a specified part from this timestamp expression in a given timezone.
`final @NonNull Expression` `timestampSubtract(@NonNull Expression unit, @NonNull Expression amount)`

Creates an expression that subtracts a specified amount of time to this timestamp expression.
`final @NonNull Expression` `timestampSubtract(@NonNull String unit, long amount)`

Creates an expression that subtracts a specified amount of time to this timestamp expression.
`final @NonNull Expression` `timestampToUnixMicros()`

Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
`final @NonNull Expression` `timestampToUnixMillis()`

Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
`final @NonNull Expression` `timestampToUnixSeconds()`

Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
`final @NonNull Expression` `timestampTruncate(@NonNull Expression granularity)`

Creates an expression that truncates this timestamp expression to a specified granularity.
`final @NonNull Expression` `timestampTruncate(@NonNull String granularity)`

Creates an expression that truncates this timestamp expression to a specified granularity.
`final @NonNull Expression` `timestampTruncateWithTimezone(
@NonNull Expression granularity,
@NonNull Expression timezone
)`

Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.
`final @NonNull Expression` `timestampTruncateWithTimezone(
@NonNull Expression granularity,
@NonNull String timezone
)`

Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.
`final @NonNull Expression` `timestampTruncateWithTimezone(
@NonNull String granularity,
@NonNull Expression timezone
)`

Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.
`final @NonNull Expression` `timestampTruncateWithTimezone(
@NonNull String granularity,
@NonNull String timezone
)`

Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.
`final @NonNull Expression` `toLower()`

Creates an expression that converts this string expression to lowercase.
`final @NonNull Expression` `toUpper()`

Creates an expression that converts this string expression to uppercase.
`final @NonNull Expression` `trim()`

Creates an expression that removes leading and trailing whitespace from this string expression.
`final @NonNull Expression` `trimValue(@NonNull Expression valueToTrim)`

Creates an expression that removes a set of leading and trailing values from this expression.
`final @NonNull Expression` `trimValue(@NonNull String valueToTrim)`

Creates an expression that removes a set of leading and trailing values from this string expression.
`final @NonNull Expression` `trunc()`

Creates an expression that truncates this numeric expression to an integer.
`final @NonNull Expression` `truncToPrecision(@NonNull Expression decimalPlace)`

Creates an expression that truncates this numeric expression to `decimalPlace` decimal places if `decimalPlace` is positive, truncates digits to the left of the decimal point if `decimalPlace` is negative.
`final @NonNull Expression` `truncToPrecision(int decimalPlace)`

Creates an expression that truncates this numeric expression to `decimalPlace` decimal places if `decimalPlace` is positive, truncates digits to the left of the decimal point if `decimalPlace` is negative.
`final @NonNull Expression` `type()`

Creates an expression that returns a string indicating the type of the value this expression evaluates to.
`final @NonNull Expression` `unixMicrosToTimestamp()`

Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
`final @NonNull Expression` `unixMillisToTimestamp()`

Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
`final @NonNull Expression` `unixSecondsToTimestamp()`

Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
`final @NonNull Expression` `vectorLength()`

Creates an expression that calculates the length (dimension) of a Firestore Vector.

## Public methods

### equals

```
public boolean equals(Object other)
```

### geoDistance

```
public final @NonNull Expression geoDistance(@NonNull GeoPoint location)
```

Evaluates to the distance in meters between the location specified by this field and the query location.

Note: This Expression can only be used within a `Search` stage.

| Parameters |
|---|---|
| `@NonNull GeoPoint location` | Compute distance to this GeoPoint. |

### hashCode

```
public int hashCode()
```