Class Expression
- Direct Known Subclasses:
BooleanExpression,Field,FunctionExpression,PipelineValueExpression
Pipeline.
Expressions are the building blocks for creating complex queries and transformations in Firestore pipelines. They can represent:
- **Field references:** Access values from document fields.
- **Literals:** Represent constant values (strings, numbers, booleans).
- **Function calls:** Apply functions to one or more expressions.
The `Expression` class provides a fluent API for building expressions. You can chain together method calls to create complex expressions.
-
Method Summary
Modifier and TypeMethodDescriptionfinal Expressionabs()Creates an expression that returns the absolute value of this numeric expression.static Expressionabs(Expression numericExpr) Creates an expression that returns the absolute value ofnumericExpr.static ExpressionCreates an expression that returns the absolute value ofnumericField.static Expressionadd(Expression first, Expression second) Creates an expression that adds numeric expressions.static Expressionadd(Expression first, Number second) Creates an expression that adds numeric expressions with a constant.final ExpressionCreates an expression that adds this numeric expression to another numeric expression.static Expressionadd(String fieldName, Expression second) Creates an expression that adds a numeric field with a numeric expression.static ExpressionCreates an expression that adds a numeric field with constant.static BooleanExpressionand(BooleanExpression condition, BooleanExpression... conditions) Creates an expression that performs a logical 'AND' operation.static ExpressionCreates an expression that creates a Firestore array value from an input object.static ExpressionCreates an expression that creates a Firestore array value from an input object.final AggregateFunctionarrayAgg()Creates an aggregation that collects all values of this expression across multiple stage inputs into an array.final AggregateFunctionCreates an aggregation that collects all distinct values of this expression across multiple stage inputs into an array.final ExpressionarrayConcat(Expression... otherArrays) Creates an expression that concatenates a field's array value with other arrays.static ExpressionarrayConcat(Expression firstArray, Object... otherArrays) Creates an expression that concatenates multiple arrays into a single array.static ExpressionarrayConcat(String firstArrayField, Object... otherArrays) Creates an expression that concatenates multiple arrays into a single array.static BooleanExpressionarrayContains(Expression array, Expression element) Creates an expression that checks if an array contains a specified element.static BooleanExpressionarrayContains(Expression array, Object element) Creates an expression that checks if an array contains a specified element.final BooleanExpressionarrayContains(Object element) Creates an expression that checks if array contains a specificelement.static BooleanExpressionarrayContains(String arrayFieldName, Expression element) Creates an expression that checks if an array contains a specified element.static BooleanExpressionarrayContains(String arrayFieldName, Object element) Creates an expression that checks if an array contains a specified element.final BooleanExpressionarrayContainsAll(Expression arrayExpression) Creates an expression that checks if array contains all elements ofarrayExpression.static BooleanExpressionarrayContainsAll(Expression array, Expression arrayExpression) Creates an expression that checks if an array contains all of the elements of another array.static BooleanExpressionarrayContainsAll(Expression array, List<Object> values) Creates an expression that checks if an array contains all of the provided values.static BooleanExpressionarrayContainsAll(String arrayFieldName, Expression arrayExpression) Creates an expression that checks if an array contains all of the elements of another array.static BooleanExpressionarrayContainsAll(String arrayFieldName, List<Object> values) Creates an expression that checks if an array contains all of the provided values.final BooleanExpressionarrayContainsAll(List<Object> values) Creates an expression that checks if array contains all the specifiedvalues.final BooleanExpressionarrayContainsAny(Expression arrayExpression) Creates an expression that checks if array contains any elements ofarrayExpression.static BooleanExpressionarrayContainsAny(Expression array, Expression arrayExpression) Creates an expression that checks if an array contains any of the elements of another array.static BooleanExpressionarrayContainsAny(Expression array, List<Object> values) Creates an expression that checks if an array contains any of the provided values.static BooleanExpressionarrayContainsAny(String arrayFieldName, Expression arrayExpression) Creates an expression that checks if an array contains any of the elements of another array.static BooleanExpressionarrayContainsAny(String arrayFieldName, List<Object> values) Creates an expression that checks if an array contains any of the provided values.final BooleanExpressionarrayContainsAny(List<Object> values) Creates an expression that checks if array contains any of the specifiedvalues.static ExpressionarrayFilter(Expression array, String alias, BooleanExpression filter) Filters an array expression based on a predicate.final ExpressionarrayFilter(String alias, BooleanExpression filter) Filters this array based on a predicate.static ExpressionarrayFilter(String arrayFieldName, String alias, BooleanExpression filter) Filters an array field based on a predicate.final ExpressionReturns the first element of an array.static ExpressionarrayFirst(Expression array) Creates an expression that returns the first element of an array.static ExpressionarrayFirst(String arrayFieldName) Creates an expression that returns the first element of an array.final ExpressionarrayFirstN(int n) Returns the first n elements of an array.final ExpressionReturns the first n elements of an array.static ExpressionarrayFirstN(Expression array, int n) Creates an expression that returns the first n elements of an array.static ExpressionarrayFirstN(Expression array, Expression n) Creates an expression that returns the first n elements of an array.static ExpressionarrayFirstN(String arrayFieldName, int n) Creates an expression that returns the first n elements of an array.static ExpressionarrayFirstN(String arrayFieldName, Expression n) Creates an expression that returns the first n elements of an array.final ExpressionarrayGet(int offset) Creates an expression that indexes into an array from the beginning or end and return the element.final ExpressionarrayGet(Expression offset) Creates an expression that indexes into an array from the beginning or end and return the element.static ExpressionarrayGet(Expression array, int offset) Creates an expression that returns an element from an array at a specified index.static ExpressionarrayGet(Expression array, Expression offset) Creates an expression that returns an element from an array at a specified index.static ExpressionCreates an expression that returns an element from an array at a specified index.static ExpressionarrayGet(String arrayFieldName, Expression offset) Creates an expression that returns an element from an array at a specified index.final ExpressionarrayIndexOf(Expression value) Returns the index of the first occurrence of a value in an array.static ExpressionarrayIndexOf(Expression array, Expression value) Creates an expression that returns the index of the first occurrence of a value in an array.static ExpressionarrayIndexOf(Expression array, Object value) Creates an expression that returns the index of the first occurrence of a value in an array.final ExpressionarrayIndexOf(Object value) Returns the index of the first occurrence of a value in an array.static ExpressionarrayIndexOf(String arrayFieldName, Expression value) Creates an expression that returns the index of the first occurrence of a value in an array.static ExpressionarrayIndexOf(String arrayFieldName, Object value) Creates an expression that returns the index of the first occurrence of a value in an array.final ExpressionarrayIndexOfAll(Expression value) Returns all indices of a value in an array.static ExpressionarrayIndexOfAll(Expression array, Expression value) Creates an expression that returns all indices of a value in an array.static ExpressionarrayIndexOfAll(Expression array, Object value) Creates an expression that returns all indices of a value in an array.final ExpressionarrayIndexOfAll(Object value) Returns all indices of a value in an array.static ExpressionarrayIndexOfAll(String arrayFieldName, Expression value) Creates an expression that returns all indices of a value in an array.static ExpressionarrayIndexOfAll(String arrayFieldName, Object value) Creates an expression that returns all indices of a value in an array.final ExpressionReturns the last element of an array.static ExpressionarrayLast(Expression array) Creates an expression that returns the last element of an array.static ExpressionCreates an expression that returns the last element of an array.final ExpressionarrayLastIndexOf(Expression value) Returns the index of the last occurrence of a value in an array.static ExpressionarrayLastIndexOf(Expression array, Expression value) Creates an expression that returns the index of the last occurrence of a value in an array.static ExpressionarrayLastIndexOf(Expression array, Object value) Creates an expression that returns the index of the last occurrence of a value in an array.final ExpressionarrayLastIndexOf(Object value) Returns the index of the last occurrence of a value in an array.static ExpressionarrayLastIndexOf(String arrayFieldName, Expression value) Creates an expression that returns the index of the last occurrence of a value in an array.static ExpressionarrayLastIndexOf(String arrayFieldName, Object value) Creates an expression that returns the index of the last occurrence of a value in an array.final ExpressionarrayLastN(int n) Returns the last n elements of an array.final ExpressionReturns the last n elements of an array.static ExpressionarrayLastN(Expression array, int n) Creates an expression that returns the last n elements of an array.static ExpressionarrayLastN(Expression array, Expression n) Creates an expression that returns the last n elements of an array.static ExpressionarrayLastN(String arrayFieldName, int n) Creates an expression that returns the last n elements of an array.static ExpressionarrayLastN(String arrayFieldName, Expression n) Creates an expression that returns the last n elements of an array.final ExpressionCreates an expression that calculates the length of an array expression.static ExpressionarrayLength(Expression array) Creates an expression that returns the length of an array.static ExpressionarrayLength(String arrayFieldName) Creates an expression that returns the length of an array.final ExpressionReturns the maximum value of an array.static ExpressionarrayMaximum(Expression array) Creates an expression that returns the maximum value of an array.static ExpressionarrayMaximum(String arrayFieldName) Creates an expression that returns the maximum value of an array.final ExpressionarrayMaximumN(int n) Returns the n maximum values of an array.final ExpressionReturns the n maximum values of an array.static ExpressionarrayMaximumN(Expression array, int n) Creates an expression that returns the n maximum values of an array.static ExpressionarrayMaximumN(Expression array, Expression n) Creates an expression that returns the n maximum values of an array.static ExpressionarrayMaximumN(String arrayFieldName, int n) Creates an expression that returns the n maximum values of an array.static ExpressionarrayMaximumN(String arrayFieldName, Expression n) Creates an expression that returns the n maximum values of an array.final ExpressionReturns the minimum value of an array.static ExpressionarrayMinimum(Expression array) Creates an expression that returns the minimum value of an array.static ExpressionarrayMinimum(String arrayFieldName) Creates an expression that returns the minimum value of an array.final ExpressionarrayMinimumN(int n) Returns the n minimum values of an array.final ExpressionReturns the n minimum values of an array.static ExpressionarrayMinimumN(Expression array, int n) Creates an expression that returns the n minimum values of an array.static ExpressionarrayMinimumN(Expression array, Expression n) Creates an expression that returns the n minimum values of an array.static ExpressionarrayMinimumN(String arrayFieldName, int n) Creates an expression that returns the n minimum values of an array.static ExpressionarrayMinimumN(String arrayFieldName, Expression n) Creates an expression that returns the n minimum values of an array.final ExpressionReverses the order of elements in the array.static ExpressionarrayReverse(Expression array) Creates an expression that reverses an array.static ExpressionarrayReverse(String arrayFieldName) Creates an expression that reverses an array.final ExpressionarraySlice(int offset, int length) Returns a slice of this array.static ExpressionarraySlice(Expression array, int offset, int length) Creates an expression that returns a slice of an array.final ExpressionarraySlice(Expression offset, Expression length) Returns a slice of this array.static ExpressionarraySlice(Expression array, Expression offset, Expression length) Creates an expression that returns a slice of an array.static ExpressionarraySlice(String arrayFieldName, int offset, int length) Creates an expression that returns a slice of an array.static ExpressionarraySlice(String arrayFieldName, Expression offset, Expression length) Creates an expression that returns a slice of an array.final ExpressionarraySliceToEnd(int offset) Returns a slice of this array to its end.final ExpressionarraySliceToEnd(Expression offset) Returns a slice of this array to its end.static ExpressionarraySliceToEnd(Expression array, int offset) Creates an expression that returns a slice of an array to its end.static ExpressionarraySliceToEnd(Expression array, Expression offset) Creates an expression that returns a slice of an array to its end.static ExpressionarraySliceToEnd(String arrayFieldName, int offset) Creates an expression that returns a slice of an array to its end.static ExpressionarraySliceToEnd(String arrayFieldName, Expression offset) Creates an expression that returns a slice of an array to its end.arraySum()Creates an expression that returns the sum of the elements of this array expression.static ExpressionarraySum(Expression array) Creates an expression that returns the sum of the elements of an array.static ExpressionCreates an expression that returns the sum of the elements of an array.static ExpressionarrayTransform(Expression array, String elementAlias, Expression transform) Creates an expression that applies a provided transformation to each element in an array.final ExpressionarrayTransform(String elementAlias, Expression transform) Creates an expression that applies a provided transformation to each element in an array.static ExpressionarrayTransform(String arrayFieldName, String elementAlias, Expression transform) Creates an expression that applies a provided transformation to each element in an array.static ExpressionarrayTransformWithIndex(Expression array, String elementAlias, String indexAlias, 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 ExpressionarrayTransformWithIndex(String elementAlias, String indexAlias, 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.static ExpressionarrayTransformWithIndex(String arrayFieldName, String elementAlias, String indexAlias, 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.Assigns an alias to this expression.final OrderingCreate anOrderingthat sorts documents in ascending order based on value of this expressionfinal AggregateFunctionaverage()Creates an aggregation that calculates the average (mean) of this numeric expression across multiple stage inputs.final BooleanExpressionbetween(Expression lowerBound, Expression upperBound) final BooleanExpressionfinal ExpressionCreates an expression that calculates the length of a string in UTF-8 bytes, or just the length of a Blob.static ExpressionbyteLength(Expression string) Creates an expression that calculates the length of a string in UTF-8 bytes, or just the length of a Blob.static ExpressionbyteLength(String fieldName) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.final Expressionceil()Creates an expression that returns the smallest integer that isn't less than this numeric expression.static Expressionceil(Expression numericExpr) Creates an expression that returns the smallest integer that isn't less thannumericExpr.static ExpressionCreates an expression that returns the smallest integer that isn't less thannumericField.final ExpressionCreates an expression that calculates the character length of this string expression in UTF8.static ExpressioncharLength(Expression string) Creates an expression that calculates the character length of a string expression in UTF8.static ExpressioncharLength(String fieldName) Creates an expression that calculates the character length of a string field in UTF8.static Expressioncoalesce(Expression expression, Object replacement, Object... others) Returns the first non-null, non-absent argument, without evaluating the rest of the arguments.Returns the first non-null, non-absent argument, without evaluating the rest of the arguments.static ExpressionReturns the first non-null, non-absent argument, without evaluating the rest of the arguments.final ExpressionCreates an expression that returns the collection ID from this path expression.static ExpressioncollectionId(Expression path) Creates an expression that returns the collection ID from a path.static ExpressioncollectionId(String pathFieldName) Creates an expression that returns the collection ID from a path.static Expressionconcat(Expression first, Object... others) Creates an expression that concatenates expressions together.Creates an expression that concatenates this expression with other values.static ExpressionCreates an expression that concatenates expressions together.static Expressionconditional(BooleanExpression condition, Expression thenExpr, Expression elseExpr) Creates a conditional expression that evaluates to athenExprexpression if a condition is true or anelseExprexpression if the condition is false.static Expressionconditional(BooleanExpression condition, Object thenValue, Object elseValue) Creates a conditional expression that evaluates to athenValueif a condition is true or anelseValueif the condition is false.static Expressionconstant(byte[] value) Create a constant for a bytes value.static ExpressionCreate a constant for aBlobvalue.static Expressionconstant(DocumentReference value) Create a constant for aDocumentReferencevalue.static ExpressionCreate a constant for aGeoPointvalue.static Expressionconstant(VectorValue value) Create a constant for aVectorValuevalue.static Expressionconstant(com.google.cloud.Timestamp value) Create a constant for aTimestampvalue.static BooleanExpressionCreate a constant for aBooleanvalue.static ExpressionCreate a constant for aNumbervalue.static ExpressionCreate a constant for aStringvalue.static ExpressionCreate a constant for aDatevalue.final ExpressioncosineDistance(double[] vector) Calculates the Cosine distance between this vector expression and a vector literal.final ExpressioncosineDistance(Expression vector) Calculates the Cosine distance between this and another vector expressions.static ExpressioncosineDistance(Expression vector1, double[] vector2) Creates an expression that calculates the cosine distance between two vectors.static ExpressioncosineDistance(Expression vector1, Expression vector2) Creates an expression that calculates the cosine distance between two vectors.static ExpressioncosineDistance(String vectorFieldName, double[] vector) Creates an expression that calculates the cosine distance between two vectors.static ExpressioncosineDistance(String vectorFieldName, Expression vector) Creates an expression that calculates the cosine distance between two vectors.final AggregateFunctioncount()Creates an aggregation that counts the number of stage inputs with valid evaluations of the this expression.final AggregateFunctionCreates an aggregation that counts the number of distinct values of this expression.static ExpressionCreates an expression that represents the current document being processed.static ExpressionCreates an expression that returns the current timestamp.final OrderingCreate anOrderingthat sorts documents in descending order based on value of this expressionstatic Expressiondivide(Expression dividend, Expression divisor) Creates an expression that divides two numeric expressions.static Expressiondivide(Expression dividend, Number divisor) Creates an expression that divides a numeric expression by a constant.final ExpressionCreates an expression that divides this numeric expression by another numeric expression.static Expressiondivide(String fieldName, Expression divisor) Creates an expression that divides numeric field by a numeric expression.static ExpressionCreates an expression that divides a numeric field by a constant.final ExpressionCreates an expression that returns the document ID from this path expression.static ExpressiondocumentId(DocumentReference docRef) Creates an expression that returns the document ID from aDocumentReference.static ExpressiondocumentId(Expression documentPath) Creates an expression that returns the document ID from a path.static ExpressiondocumentId(String documentPath) Creates an expression that returns the document ID from a path.static BooleanExpressiondocumentMatches(String rquery) Perform a full-text search on all indexed search fields in the document.final ExpressiondotProduct(double[] vector) Calculates the dot product distance between this vector expression and a vector literal.final ExpressiondotProduct(Expression vector) Calculates the dot product distance between this and another vector expression.static ExpressiondotProduct(Expression vector1, double[] vector2) Creates an expression that calculates the dot product of two vectors.static ExpressiondotProduct(Expression vector1, Expression vector2) Creates an expression that calculates the dot product of two vectors.static ExpressiondotProduct(String vectorFieldName, double[] vector) Creates an expression that calculates the dot product of two vectors.static ExpressiondotProduct(String vectorFieldName, Expression vector) Creates an expression that calculates the dot product of two vectors.static BooleanExpressionendsWith(Expression string, Expression suffix) Creates an expression that checks if a string expression ends with a givensuffix.static BooleanExpressionendsWith(Expression string, String suffix) Creates an expression that checks if a string expression ends with a givensuffix.final BooleanExpressionCreates an expression that checks if this string expression ends with a givensuffix.static BooleanExpressionendsWith(String fieldName, Expression suffix) Creates an expression that checks if a string expression ends with a givensuffix.static BooleanExpressionCreates an expression that checks if a string expression ends with a givensuffix.static BooleanExpressionequal(Expression left, Expression right) Creates an expression that checks if two expressions are equal.static BooleanExpressionequal(Expression left, Object right) Creates an expression that checks if an expression is equal to a constant value.final BooleanExpressionCreates an expression that checks if this expression is equal to avalue.static BooleanExpressionequal(String fieldName, Expression right) Creates an expression that checks if a field is equal to an expression.static BooleanExpressionCreates an expression that checks if a field is equal to a constant value.static BooleanExpressionequalAny(Expression expression, Expression arrayExpression) Creates an expression that checks if anexpression, when evaluated, is equal to any of the elements ofarrayExpression.static BooleanExpressionequalAny(Expression expression, List<Object> values) Creates an expression that checks if anexpression, when evaluated, is equal to any of the providedvalues.static BooleanExpressionequalAny(String fieldName, Expression arrayExpression) Creates an expression that checks if a field's value is equal to any of the elements ofarrayExpression.static BooleanExpressionCreates an expression that checks if a field's value is equal to any of the providedvalues.final BooleanExpressionCreates an expression that checks if this expression, when evaluated, is equal to any of the providedvalues.final ExpressioneuclideanDistance(double[] vector) Calculates the Euclidean distance between this vector expression and a vector literal.final ExpressioneuclideanDistance(Expression vector) Calculates the Euclidean distance between this and another vector expression.static ExpressioneuclideanDistance(Expression vector1, double[] vector2) Creates an expression that calculates the Euclidean distance between two vectors.static ExpressioneuclideanDistance(Expression vector1, Expression vector2) Creates an expression that calculates the Euclidean distance between two vectors.static ExpressioneuclideanDistance(String vectorFieldName, double[] vector) Creates an expression that calculates the Euclidean distance between two vectors.static ExpressioneuclideanDistance(String vectorFieldName, Expression vector) Creates an expression that calculates the Euclidean distance between two vectors.final BooleanExpressionexists()Creates an expression that checks if this expression evaluates to a name of the field that exists.static BooleanExpressionexists(Expression value) Creates an expression that checks if a field exists.static BooleanExpressionCreates an expression that checks if a field exists.final Expressionexp()Creates an expression that returns Euler's number e raised to the power of this numeric expression.static Expressionexp(Expression numericExpr) Creates an expression that returns Euler's number e raised to the power ofnumericExpr.static ExpressionCreates an expression that returns Euler's number e raised to the power ofnumericField.static FieldCreates aFieldinstance representing the field at the given path.static FieldCreates aFieldinstance representing the field at the given path.final AggregateFunctionfirst()Creates an aggregation that finds the first value of this expression across multiple stage inputs.final Expressionfloor()Creates an expression that returns the largest integer that isn't less than this numeric expression.static Expressionfloor(Expression numericExpr) Creates an expression that returns the largest integer that isn't less thannumericExpr.static ExpressionCreates an expression that returns the largest integer that isn't less thannumericField.static ExpressiongeoDistance(Field field, GeoPoint location) Evaluates to the distance in meters between the location in the specified field and the query location.static ExpressiongeoDistance(String fieldName, GeoPoint location) Evaluates to the distance in meters between the location in the specified field and the query location.getField(Expression keyExpression) Retrieves the value of a specific field from the document evaluated by this expression.static ExpressiongetField(Expression expression, Expression keyExpression) Accesses a field/property of the expression using the providedkeyExpression.static ExpressiongetField(Expression expression, String key) Accesses a field/property of the expression that evaluates to a Map or Document.Accesses a field/property of the expression that evaluates to a Map or Document.static ExpressiongetField(String fieldName, Expression keyExpression) Accesses a field/property of a document field using the providedkeyExpression.static ExpressionAccesses a field/property of a document field using the providedkey.static BooleanExpressiongreaterThan(Expression left, Expression right) Creates an expression that checks if the first expression is greater than the second expression.static BooleanExpressiongreaterThan(Expression left, Object right) Creates an expression that checks if an expression is greater than a constant value.final BooleanExpressiongreaterThan(Object other) Creates an expression that checks if this expression is greater than avalue.static BooleanExpressiongreaterThan(String fieldName, Expression right) Creates an expression that checks if a field is greater than an expression.static BooleanExpressiongreaterThan(String fieldName, Object right) Creates an expression that checks if a field is greater than a constant value.static BooleanExpressiongreaterThanOrEqual(Expression left, Expression right) Creates an expression that checks if the first expression is greater than or equal to the second expression.static BooleanExpressiongreaterThanOrEqual(Expression left, Object right) Creates an expression that checks if an expression is greater than or equal to a constant value.final BooleanExpressiongreaterThanOrEqual(Object other) Creates an expression that checks if this expression is greater than or equal to avalue.static BooleanExpressiongreaterThanOrEqual(String fieldName, Expression right) Creates an expression that checks if a field is greater than or equal to an expression.static BooleanExpressiongreaterThanOrEqual(String fieldName, Object right) Creates an expression that checks if a field is greater than or equal to a constant value.static ExpressionifAbsent(Expression ifExpr, Expression elseExpr) Creates an expression that returns a default value if an expression evaluates to an absent value.static ExpressionifAbsent(Expression ifExpr, Object elseValue) Creates an expression that returns a default value if an expression evaluates to an absent value.Creates an expression that returns a default value if this expression evaluates to an absent value.static ExpressionifAbsent(String ifFieldName, Expression elseExpr) Creates an expression that returns a default value if a field is absent.static ExpressionCreates an expression that returns a default value if a field is absent.static BooleanExpressionifError(BooleanExpression tryExpr, BooleanExpression catchExpr) Creates an expression that returns thecatchExprargument if there is an error, else return the result of thetryExprargument evaluation.final ExpressionifError(Expression catchExpr) Creates an expression that returns thecatchExprargument if there is an error, else return the result of this expression.static ExpressionifError(Expression tryExpr, Expression catchExpr) Creates an expression that returns thecatchExprargument if there is an error, else return the result of thetryExprargument evaluation.static ExpressionifError(Expression tryExpr, Object catchValue) Creates an expression that returns thecatchValueargument if there is an error, else return the result of thetryExprargument evaluation.final ExpressionCreates an expression that returns thecatchValueargument if there is an error, else return the result of this expression.static ExpressionifNull(Expression ifExpr, Expression elseExpression) Creates an expression that returns a default value if an expression evaluates to null.static ExpressionifNull(Expression ifExpr, Object elseValue) Creates an expression that returns a default value if an expression evaluates to null.Creates an expression that returns a default value if this expression evaluates null.static ExpressionifNull(String ifFieldName, Expression elseExpression) Creates an expression that returns a default value if a field is null.static ExpressionCreates an expression that returns a default value if a field is null.final BooleanExpressionisAbsent()Creates an expression that returns true if yhe result of this expression is absent.static BooleanExpressionisAbsent(Expression value) Creates an expression that returns true if a value is absent.static BooleanExpressionCreates an expression that returns true if a field is absent.final BooleanExpressionisError()Creates an expression that checks if this expression produces an error.static BooleanExpressionisError(Expression expr) Creates an expression that checks if a given expression produces an error.final BooleanExpressionisNaN()Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number).final BooleanExpressionisNotNaN()Creates an expression that checks if the results of this expression is NOT 'NaN' (Not a Number).static BooleanExpressionisNotNaN(Expression expr) Creates an expression that checks if the results ofexpris NOT 'NaN' (Not a Number).static BooleanExpressionCreates an expression that checks if the results of this expression is NOT 'NaN' (Not a Number).final BooleanExpressionCreates an expression that checks if tbe result of this expression is not null.final BooleanExpressionisNull()Creates an expression that checks if tbe result of this expression is null.static BooleanExpressionisType(Expression expr, String type) Creates an expression that checks if the result of an expression is of the given type.final BooleanExpressionCreates an expression that checks if the result of this expression is of the given type.static BooleanExpressionCreates an expression that checks if the value of a field is of the given type.join(Expression delimiter) Creates an expression that joins the elements of this array expression into a string.static Expressionjoin(Expression arrayExpression, Expression delimiterExpression) Creates an expression that joins the elements of an array into a string.static Expressionjoin(Expression arrayExpression, String delimiter) Creates an expression that joins the elements of an array into a string.Creates an expression that joins the elements of this array expression into a string.static Expressionjoin(String arrayFieldName, Expression delimiterExpression) Creates an expression that joins the elements of an array into a string.static ExpressionCreates an expression that joins the elements of an array into a string.final AggregateFunctionlast()Creates an aggregation that finds the last value of this expression across multiple stage inputs.final Expressionlength()Creates an expression that calculates the length of the expression if it is a string, array, map, or Blob.static Expressionlength(Expression string) Creates an expression that calculates the length of string, array, map, vector, or Blob.static ExpressionCreates an expression that calculates the length of string, array, map, vector, or Blob.static BooleanExpressionlessThan(Expression left, Expression right) Creates an expression that checks if the first expression is less than the second expression.static BooleanExpressionlessThan(Expression left, Object right) Creates an expression that checks if an expression is less than a constant value.final BooleanExpressionCreates an expression that checks if this expression is less than a value.static BooleanExpressionlessThan(String fieldName, Expression right) Creates an expression that checks if a field is less than an expression.static BooleanExpressionCreates an expression that checks if a field is less than a constant value.static BooleanExpressionlessThanOrEqual(Expression left, Expression right) Creates an expression that checks if the first expression is less than or equal to the second expression.static BooleanExpressionlessThanOrEqual(Expression left, Object right) Creates an expression that checks if an expression is less than or equal to a constant value.final BooleanExpressionlessThanOrEqual(Object other) Creates an expression that checks if this expression is less than or equal to avalue.static BooleanExpressionlessThanOrEqual(String fieldName, Expression right) Creates an expression that checks if a field is less than or equal to an expression.static BooleanExpressionlessThanOrEqual(String fieldName, Object right) Creates an expression that checks if a field is less than or equal to a constant value.static BooleanExpressionlike(Expression string, Expression pattern) Creates an expression that performs a case-sensitive wildcard string comparison.static BooleanExpressionlike(Expression string, String pattern) Creates an expression that performs a case-sensitive wildcard string comparison.final BooleanExpressionCreates an expression that performs a case-sensitive wildcard string comparison.static BooleanExpressionlike(String fieldName, Expression pattern) Creates an expression that performs a case-sensitive wildcard string comparison against a field.static BooleanExpressionCreates an expression that performs a case-sensitive wildcard string comparison against a field.final Expressionln()Creates an expression that returns the natural logarithm (base e) of this numeric expression.static Expressionln(Expression numericExpr) Creates an expression that returns the natural logarithm (base e) ofnumericExpr.static ExpressionCreates an expression that returns the natural logarithm (base e) ofnumericField.static Expressionlog(Expression numericExpr, Expression base) Creates an expression that returns the logarithm ofnumericExprwith a givenbase.static Expressionlog(Expression numericExpr, Number base) Creates an expression that returns the logarithm ofnumericExprwith a givenbase.static Expressionlog(String numericField, Expression base) Creates an expression that returns the logarithm ofnumericFieldwith a givenbase.static ExpressionCreates an expression that returns the logarithm ofnumericFieldwith a givenbase.log10()Creates an expression that returns the base 10 logarithm of this numeric expression.static Expressionlog10(Expression numericExpr) Creates an expression that returns the base 10 logarithm ofnumericExpr.static ExpressionCreates an expression that returns the base 10 logarithm ofnumericField.static ExpressionlogicalMaximum(Expression expr, Object... others) Creates an expression that returns the largest value between multiple input expressions or literal values.final ExpressionlogicalMaximum(Object... others) Creates an expression that returns the largest value between multiple input expressions or literal values.static ExpressionlogicalMaximum(String fieldName, Object... others) Creates an expression that returns the largest value between multiple input expressions or literal values.static ExpressionlogicalMinimum(Expression expr, Object... others) Creates an expression that returns the smallest value between multiple input expressions or literal values.final ExpressionlogicalMinimum(Object... others) Creates an expression that returns the smallest value between multiple input expressions or literal values.static ExpressionlogicalMinimum(String fieldName, Object... others) Creates an expression that returns the smallest value between multiple input expressions or literal values.ltrim()Creates an expression that removes whitespace from the beginning of this string or blob expression.static Expressionltrim(Expression value) Creates an expression that removes whitespace from the beginning of a string or blob.static ExpressionCreates an expression that removes whitespace from the beginning of a string or blob.ltrimValue(Expression characters) Creates an expression that removes the specified characters or bytes from the beginning of this string or blob expression.static ExpressionltrimValue(Expression value, Expression characters) Creates an expression that removes specified characters from the beginning of a string or blob.static ExpressionltrimValue(Expression value, String characters) Creates an expression that removes specified characters from the beginning of a string or blob.ltrimValue(String characters) Creates an expression that removes the specified set of characters from the beginning of this string or blob expression.static ExpressionltrimValue(String fieldName, Expression characters) Creates an expression that removes specified characters from the beginning of a string or blob.static ExpressionltrimValue(String fieldName, String characters) Creates an expression that removes specified characters from the beginning of a string or blob.static ExpressionCreates an expression that creates a Firestore map value from an input object.final ExpressionCreates 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.static ExpressionmapEntries(Expression mapExpr) Creates an expression that returns the entries of a map as an array of maps, where each map contains a "k" property for the key and a "v" property for the value.static ExpressionmapEntries(String mapField) Creates an expression that returns the entries of a map as an array of maps.static ExpressionmapGet(Expression map, Expression key) Accesses a value from a map (object) field using the providedkeyExpression.static ExpressionmapGet(Expression map, String key) Accesses a value from a map (object) field using the providedkey.final ExpressionAccesses a map (object) value using the providedkey.static ExpressionmapGet(String fieldName, Expression key) Accesses a value from a map (object) field using the providedkeyExpression.static ExpressionAccesses a value from a map (object) field using the providedkey.final ExpressionmapKeys()Creates an expression that returns the keys of this map expression.static ExpressionmapKeys(Expression mapExpr) Creates an expression that returns the keys of a map.static ExpressionCreates an expression that returns the keys of a map.static ExpressionmapMerge(Expression firstMap, Expression secondMap) final ExpressionmapMerge(Expression secondMap, Expression... otherMaps) Creates an expression that merges multiple maps into a single map.static ExpressionmapMerge(Expression firstMap, Expression secondMap, Expression... otherMaps) Creates an expression that merges multiple maps into a single map.static ExpressionmapMerge(String firstMapFieldName, Expression secondMap) static ExpressionmapMerge(String firstMapFieldName, Expression secondMap, Expression... otherMaps) Creates an expression that merges multiple maps into a single map.final ExpressionmapRemove(Expression key) Creates an expression that removes a key from this map expression.static ExpressionmapRemove(Expression mapExpr, Expression key) Creates an expression that removes a key from a map.static ExpressionmapRemove(Expression mapExpr, String key) Creates an expression that removes a key from a map.final ExpressionCreates an expression that removes a key from this map expression.static ExpressionmapRemove(String mapField, Expression key) Creates an expression that removes a key from a map.static ExpressionCreates an expression that removes a key from a map.final ExpressionmapSet(Expression key, Expression value, Expression... moreKeyValues) Creates an expression that returns a new map with the specified entries added or updated.static ExpressionmapSet(Expression mapExpr, Expression key, Expression value, Expression... moreKeyValues) Creates an expression that returns a new map with the specified entries added or updated.static ExpressionmapSet(Expression mapExpr, String key, Object value, Object... moreKeyValues) Creates an expression that returns a new map with the specified entries added or updated.static ExpressionmapSet(String mapField, Expression key, Expression value, Expression... moreKeyValues) Creates an expression that returns a new map with the specified entries added or updated.final ExpressionCreates an expression that returns a new map with the specified entries added or updated.static ExpressionCreates an expression that returns a new map with the specified entries added or updated.final ExpressionCreates an expression that returns the values of this map expression.static ExpressionmapValues(Expression mapExpr) Creates an expression that returns the values of a map.static ExpressionCreates an expression that returns the values of a map.final AggregateFunctionmaximum()Creates an aggregation that finds the maximum value of this expression across multiple stage inputs.final AggregateFunctionminimum()Creates an aggregation that finds the minimum value of this expression across multiple stage inputs.static Expressionmod(Expression dividend, Expression divisor) Creates an expression that calculates the modulo (remainder) of dividing two numeric expressions.static Expressionmod(Expression dividend, Number divisor) Creates an expression that calculates the modulo (remainder) of dividing a numeric expression by a constant.final ExpressionCreates an expression that calculates the modulo (remainder) of dividing this numeric expressions by another numeric expression.static Expressionmod(String fieldName, Expression divisor) Creates an expression that calculates the modulo (remainder) of dividing a numeric field by a constant.static ExpressionCreates an expression that calculates the modulo (remainder) of dividing a numeric field by a constant.static Expressionmultiply(Expression first, Expression second) Creates an expression that multiplies numeric expressions.static Expressionmultiply(Expression first, Number second) Creates an expression that multiplies numeric expressions with a constant.final ExpressionCreates an expression that multiplies this numeric expression with another numeric expression.static Expressionmultiply(String fieldName, Expression second) Creates an expression that multiplies a numeric field with a numeric expression.static ExpressionCreates an expression that multiplies a numeric field with a constant.static BooleanExpressionnor(BooleanExpression condition, BooleanExpression... conditions) Creates an expression that performs a logical 'NOR' operation.static BooleanExpressionnot(BooleanExpression condition) Creates an expression that negates a boolean expression.static BooleanExpressionnotEqual(Expression left, Expression right) Creates an expression that checks if two expressions are not equal.static BooleanExpressionnotEqual(Expression left, Object right) Creates an expression that checks if an expression is not equal to a constant value.final BooleanExpressionCreates an expression that checks if this expression is not equal to avalue.static BooleanExpressionnotEqual(String fieldName, Expression right) Creates an expression that checks if a field is not equal to an expression.static BooleanExpressionCreates an expression that checks if a field is not equal to a constant value.static BooleanExpressionnotEqualAny(Expression expression, Expression arrayExpression) Creates an expression that checks if anexpression, when evaluated, is not equal to all the elements ofarrayExpression.static BooleanExpressionnotEqualAny(Expression expression, List<Object> values) Creates an expression that checks if anexpression, when evaluated, is not equal to all the providedvalues.static BooleanExpressionnotEqualAny(String fieldName, Expression arrayExpression) Creates an expression that checks if a field's value is not equal to all of the elements ofarrayExpression.static BooleanExpressionnotEqualAny(String fieldName, List<Object> values) Creates an expression that checks if a field's value is not equal to all of the providedvalues.final BooleanExpressionnotEqualAny(List<Object> other) Creates an expression that checks if this expression, when evaluated, is not equal to all the providedvalues.static ExpressionConstant for a null value.static BooleanExpressionor(BooleanExpression condition, BooleanExpression... conditions) Creates an expression that performs a logical 'OR' operation.final Expressionparent()Creates an expression that returns the parent document of a document reference.static Expressionparent(DocumentReference docRef) Creates an expression that returns the parent document of a document reference.static Expressionparent(Expression documentPath) Creates an expression that returns the parent document of a document reference.static ExpressionCreates an expression that returns the parent document of a document reference.final Expressionpow(Expression exponent) Creates an expression that returns this numeric expression raised to the power of theexponent.static Expressionpow(Expression numericExpr, Expression exponent) Creates an expression that returns thenumericExprraised to the power of theexponent.static Expressionpow(Expression numericExpr, Number exponent) Creates an expression that returns thenumericExprraised to the power of theexponent.final ExpressionCreates an expression that returns this numeric expression raised to the power of theexponent.static Expressionpow(String numericField, Expression exponent) Creates an expression that returns thenumericFieldraised to the power of theexponent.static ExpressionCreates an expression that returns thenumericFieldraised to the power of theexponent.static Expressionrand()Creates an expression that returns a random double between 0.0 and 1.0 but not including 1.0.static ExpressionrawExpression(String name, Expression... expr) Creates a generic function expression that is not yet implemented.static BooleanExpressionregexContains(Expression string, Expression pattern) Creates an expression that checks if a string expression contains a specified regular expression as a substring.static BooleanExpressionregexContains(Expression string, String pattern) Creates an expression that checks if a string expression contains a specified regular expression as a substring.final BooleanExpressionregexContains(Object pattern) Creates an expression that checks if this string expression contains a specified regular expression as a substring.static BooleanExpressionregexContains(String fieldName, Expression pattern) Creates an expression that checks if a string field contains a specified regular expression as a substring.static BooleanExpressionregexContains(String fieldName, String pattern) Creates an expression that checks if a string field contains a specified regular expression as a substring.static ExpressionregexFind(Expression string, Expression pattern) Creates an expression that returns the first substring of a string expression that matches a specified regular expression.static ExpressionregexFind(Expression string, String pattern) Creates an expression that returns the first substring of a string expression that matches a specified regular expression.final ExpressionCreates an expression that returns the first substring of a string expression that matches a specified regular expression.static ExpressionregexFind(String fieldName, Expression pattern) Creates an expression that returns the first substring of a string field that matches a specified regular expression.static ExpressionCreates an expression that returns the first substring of a string field that matches a specified regular expression.static ExpressionregexFindAll(Expression string, Expression pattern) Creates an expression that evaluates to a list of all substrings in a string expression that match a specified regular expression.static ExpressionregexFindAll(Expression string, String pattern) Creates an expression that evaluates to a list of all substrings in a string expression that match a specified regular expression.final ExpressionregexFindAll(Object pattern) Creates an expression that evaluates to a list of all substrings in a string expression that match a specified regular expression.static ExpressionregexFindAll(String fieldName, Expression pattern) Creates an expression that evaluates to a list of all substrings in a string field that match a specified regular expression.static ExpressionregexFindAll(String fieldName, String pattern) Creates an expression that evaluates to a list of all substrings in a string field that match a specified regular expression.static BooleanExpressionregexMatch(Expression string, Expression pattern) Creates an expression that checks if a string field matches a specified regular expression.static BooleanExpressionregexMatch(Expression string, String pattern) Creates an expression that checks if a string field matches a specified regular expression.final BooleanExpressionregexMatch(Object pattern) Creates an expression that checks if this string expression matches a specified regular expression.static BooleanExpressionregexMatch(String fieldName, Expression pattern) Creates an expression that checks if a string field matches a specified regular expression.static BooleanExpressionregexMatch(String fieldName, String pattern) Creates an expression that checks if a string field matches a specified regular expression.final Expressionreverse()Creates an expression that reverses this expression, which must be a string, blob, or array.static Expressionreverse(Expression expr) Creates an expression that reverses a string, blob, or array.static ExpressionCreates an expression that reverses the field value, which must be a string, blob, or array.final Expressionround()Creates an expression that rounds this numeric expression to nearest integer.static Expressionround(Expression numericExpr) Creates an expression that roundsnumericExprto nearest integer.static ExpressionCreates an expression that roundsnumericFieldto nearest integer.final ExpressionroundToPrecision(int decimalPlace) Creates an expression that rounds off this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative.final ExpressionroundToPrecision(Expression decimalPlace) Creates an expression that rounds off this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressionroundToPrecision(Expression numericExpr, int decimalPlace) Creates an expression that rounds offnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressionroundToPrecision(Expression numericExpr, Expression decimalPlace) Creates an expression that rounds offnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressionroundToPrecision(String numericField, int decimalPlace) Creates an expression that rounds offnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressionroundToPrecision(String numericField, Expression decimalPlace) Creates an expression that rounds offnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative.rtrim()Creates an expression that removes whitespace from the end of this string or blob expression.static Expressionrtrim(Expression value) Creates an expression that removes whitespace from the end of a string or blob.static ExpressionCreates an expression that removes whitespace from the end of a string or blob.rtrimValue(Expression characters) Creates an expression that removes the specified characters or bytes from the end of this string or blob expression.static ExpressionrtrimValue(Expression value, Expression characters) Creates an expression that removes specified characters from the end of a string or blob.static ExpressionrtrimValue(Expression value, String characters) Creates an expression that removes specified characters from the end of a string or blob.rtrimValue(String characters) Creates an expression that removes the specified set of characters from the end of this string or blob expression.static ExpressionrtrimValue(String fieldName, Expression characters) Creates an expression that removes specified characters from the end of a string or blob.static ExpressionrtrimValue(String fieldName, String characters) Creates an expression that removes specified characters from the end of a string or blob.static Expressionscore()Evaluates to the search score that reflects the topicality of the document to all of the text predicates (for example:documentMatches) in the search query.split(Expression delimiter) Creates an expression that splits this string or blob expression by a delimiter.static Expressionsplit(Expression value, Expression delimiter) Creates an expression that splits a string or blob by a delimiter.static Expressionsplit(Expression value, String delimiter) Creates an expression that splits a string or blob by a delimiter.Creates an expression that splits this string or blob expression by a delimiter.static Expressionsplit(String fieldName, Expression delimiter) Creates an expression that splits a string or blob by a delimiter.static ExpressionCreates an expression that splits a string or blob by a delimiter.final Expressionsqrt()Creates an expression that returns the square root of this numeric expression.static Expressionsqrt(Expression numericExpr) Creates an expression that returns the square root ofnumericExpr.static ExpressionCreates an expression that returns the square root ofnumericField.static BooleanExpressionstartsWith(Expression string, Expression prefix) Creates an expression that checks if a string expression starts with a givenprefix.static BooleanExpressionstartsWith(Expression string, String prefix) Creates an expression that checks if a string expression starts with a givenprefix.final BooleanExpressionstartsWith(Object prefix) Creates an expression that checks if this string expression starts with a givenprefix.static BooleanExpressionstartsWith(String fieldName, Expression prefix) Creates an expression that checks if a string expression starts with a givenprefix.static BooleanExpressionstartsWith(String fieldName, String prefix) Creates an expression that checks if a string expression starts with a givenprefix.final ExpressionstringConcat(Expression... others) Creates an expression that concatenates string expressions together.static ExpressionstringConcat(Expression firstString, Object... otherStrings) Creates an expression that concatenates string expressions together.final ExpressionstringConcat(String... others) Creates an expression that concatenates string expressions and string constants together.static ExpressionstringConcat(String fieldName, Object... otherStrings) Creates an expression that concatenates string expressions together.static BooleanExpressionstringContains(Expression string, Expression substring) Creates an expression that checks if a string expression contains a specified substring.static BooleanExpressionstringContains(Expression string, String substring) Creates an expression that checks if a string expression contains a specified substring.final BooleanExpressionstringContains(Object substring) Creates an expression that checks if this string expression contains a specified substring.static BooleanExpressionstringContains(String fieldName, Expression substring) Creates an expression that checks if a string field contains a specified substring.static BooleanExpressionstringContains(String fieldName, String substring) Creates an expression that checks if a string field contains a specified substring.stringIndexOf(Expression search) Creates an expression that returns the index of the first occurrence of a substring or bytes.static ExpressionstringIndexOf(Expression value, Expression search) Creates an expression that returns the index of the first occurrence of a substring or bytes.static ExpressionstringIndexOf(Expression value, String search) Creates an expression that returns the index of the first occurrence of a substring or bytes.stringIndexOf(String search) Creates an expression that returns the index of the first occurrence of a substring or bytes.static ExpressionstringIndexOf(String fieldName, Expression search) Creates an expression that returns the index of the first occurrence of a substring or bytes.static ExpressionstringIndexOf(String fieldName, String search) Creates an expression that returns the index of the first occurrence of a substring or bytes.stringRepeat(Expression repetitions) Creates an expression that repeats a string or blob a specified number of times.static ExpressionstringRepeat(Expression value, Expression repetitions) Creates an expression that repeats a string or blob a specified number of times.static ExpressionstringRepeat(Expression value, Number repetitions) Creates an expression that repeats a string or blob a specified number of times.stringRepeat(Number repetitions) Creates an expression that repeats a string or blob a specified number of times.static ExpressionstringRepeat(String fieldName, Expression repetitions) Creates an expression that repeats a string or blob a specified number of times.static ExpressionstringRepeat(String fieldName, Number repetitions) Creates an expression that repeats a string or blob a specified number of times.stringReplaceAll(Expression find, Expression replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.static ExpressionstringReplaceAll(Expression value, Expression find, Expression replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.static ExpressionstringReplaceAll(Expression value, String find, String replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.static ExpressionstringReplaceAll(String fieldName, Expression find, Expression replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.stringReplaceAll(String find, String replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.static ExpressionstringReplaceAll(String fieldName, String find, String replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.stringReplaceOne(Expression find, Expression replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.static ExpressionstringReplaceOne(Expression value, Expression find, Expression replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.static ExpressionstringReplaceOne(Expression value, String find, String replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.static ExpressionstringReplaceOne(String fieldName, Expression find, Expression replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.stringReplaceOne(String find, String replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.static ExpressionstringReplaceOne(String fieldName, String find, String replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.static Expressionsubstring(Expression string, Expression index, Expression length) Creates an expression that returns a substring of the given string.final ExpressionCreates an expression that returns a substring of the given string.static ExpressionCreates an expression that returns a substring of the given string.static Expressionsubtract(Expression minuend, Expression subtrahend) Creates an expression that subtracts two expressions.static Expressionsubtract(Expression minuend, Number subtrahend) Creates an expression that subtracts a constant value from a numeric expression.final ExpressionCreates an expression that subtracts a numeric expressions from this numeric expression.static Expressionsubtract(String fieldName, Expression subtrahend) Creates an expression that subtracts a numeric expressions from numeric field.static ExpressionCreates an expression that subtracts a constant from numeric field.final AggregateFunctionsum()Creates an aggregation that calculates the sum of this numeric expression across multiple stage inputs.static ExpressionswitchOn(BooleanExpression condition, Expression result, Object... others) Creates an expression that evaluates to the result corresponding to the first true condition.final ExpressiontimestampAdd(Expression unit, Expression amount) Creates an expression that adds a specified amount of time to this timestamp expression.static ExpressiontimestampAdd(Expression timestamp, Expression unit, Expression amount) Creates an expression that adds a specified amount of time to a timestamp.static ExpressiontimestampAdd(Expression timestamp, String unit, long amount) Creates an expression that adds a specified amount of time to a timestamp.final ExpressiontimestampAdd(String unit, long amount) Creates an expression that adds a specified amount of time to this timestamp expression.static ExpressiontimestampAdd(String fieldName, Expression unit, Expression amount) Creates an expression that adds a specified amount of time to a timestamp.static ExpressiontimestampAdd(String fieldName, String unit, long amount) Creates an expression that adds a specified amount of time to a timestamp.final ExpressiontimestampDiff(Expression start, Expression unit) Calculates the difference between this timestamp and another timestamp.static ExpressiontimestampDiff(Expression end, Expression start, Expression unit) Creates an expression that calculates the difference between two timestamps.static ExpressiontimestampDiff(Expression end, Expression start, String unit) Creates an expression that calculates the difference between two timestamps.final ExpressiontimestampDiff(Expression start, String unit) Calculates the difference between this timestamp and another timestamp.static ExpressiontimestampDiff(Expression end, String startFieldName, String unit) Creates an expression that calculates the difference between two timestamps.static ExpressiontimestampDiff(String endFieldName, Expression start, String unit) Creates an expression that calculates the difference between two timestamps.final ExpressiontimestampDiff(String startFieldName, String unit) Calculates the difference between this timestamp and another timestamp.static ExpressiontimestampDiff(String endFieldName, String startFieldName, String unit) Creates an expression that calculates the difference between two timestamps.final ExpressiontimestampExtract(Expression part) Creates an expression that extracts a specified part from this timestamp expression.static ExpressiontimestampExtract(Expression timestamp, Expression part) Creates an expression that extracts a specified part from a timestamp.static ExpressiontimestampExtract(Expression timestamp, String part) Creates an expression that extracts a specified part from a timestamp.final ExpressiontimestampExtract(String part) Creates an expression that extracts a specified part from this timestamp expression.static ExpressiontimestampExtract(String fieldName, Expression part) Creates an expression that extracts a specified part from a timestamp.static ExpressiontimestampExtract(String fieldName, String part) Creates an expression that extracts a specified part from a timestamp.final ExpressiontimestampExtractWithTimezone(Expression part, Expression timezone) Creates an expression that extracts a specified part from this timestamp expression in a given timezone.static ExpressiontimestampExtractWithTimezone(Expression timestamp, Expression part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.static ExpressiontimestampExtractWithTimezone(Expression timestamp, Expression part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.final ExpressiontimestampExtractWithTimezone(Expression part, String timezone) Creates an expression that extracts a specified part from this timestamp expression in a given timezone.static ExpressiontimestampExtractWithTimezone(Expression timestamp, String part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.static ExpressiontimestampExtractWithTimezone(Expression timestamp, String part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.final ExpressiontimestampExtractWithTimezone(String part, Expression timezone) Creates an expression that extracts a specified part from this timestamp expression in a given timezone.static ExpressiontimestampExtractWithTimezone(String fieldName, Expression part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.static ExpressiontimestampExtractWithTimezone(String fieldName, Expression part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.final ExpressiontimestampExtractWithTimezone(String part, String timezone) Creates an expression that extracts a specified part from this timestamp expression in a given timezone.static ExpressiontimestampExtractWithTimezone(String fieldName, String part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.static ExpressiontimestampExtractWithTimezone(String fieldName, String part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.final ExpressiontimestampSubtract(Expression unit, Expression amount) Creates an expression that subtracts a specified amount of time to this timestamp expression.static ExpressiontimestampSubtract(Expression timestamp, Expression unit, Expression amount) Creates an expression that subtracts a specified amount of time to a timestamp.static ExpressiontimestampSubtract(Expression timestamp, String unit, long amount) Creates an expression that subtracts a specified amount of time to a timestamp.final ExpressiontimestampSubtract(String unit, long amount) Creates an expression that subtracts a specified amount of time to this timestamp expression.static ExpressiontimestampSubtract(String fieldName, Expression unit, Expression amount) Creates an expression that subtracts a specified amount of time to a timestamp.static ExpressiontimestampSubtract(String fieldName, String unit, long amount) Creates an expression that subtracts a specified amount of time to a timestamp.final ExpressionCreates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).static ExpressionCreates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).static ExpressiontimestampToUnixMicros(String fieldName) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).final ExpressionCreates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).static ExpressionCreates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).static ExpressiontimestampToUnixMillis(String fieldName) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).final ExpressionCreates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).static ExpressionCreates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).static ExpressiontimestampToUnixSeconds(String fieldName) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).final ExpressiontimestampTruncate(Expression granularity) Creates an expression that truncates this timestamp expression to a specified granularity.static ExpressiontimestampTruncate(Expression timestamp, Expression granularity) Creates an expression that truncates a timestamp to a specified granularity.static ExpressiontimestampTruncate(Expression timestamp, String granularity) Creates an expression that truncates a timestamp to a specified granularity.final ExpressiontimestampTruncate(String granularity) Creates an expression that truncates this timestamp expression to a specified granularity.static ExpressiontimestampTruncate(String fieldName, Expression granularity) Creates an expression that truncates a timestamp to a specified granularity.static ExpressiontimestampTruncate(String fieldName, String granularity) Creates an expression that truncates a timestamp to a specified granularity.final ExpressiontimestampTruncateWithTimezone(Expression granularity, Expression timezone) Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(Expression timestamp, Expression granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(Expression timestamp, Expression granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.final ExpressiontimestampTruncateWithTimezone(Expression granularity, String timezone) Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(Expression timestamp, String granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(Expression timestamp, String granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.final ExpressiontimestampTruncateWithTimezone(String granularity, Expression timezone) Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(String fieldName, Expression granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(String fieldName, Expression granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.final ExpressiontimestampTruncateWithTimezone(String granularity, String timezone) Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(String fieldName, String granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.static ExpressiontimestampTruncateWithTimezone(String fieldName, String granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.final ExpressiontoLower()Creates an expression that converts this string expression to lowercase.static ExpressiontoLower(Expression string) Creates an expression that converts a string expression to lowercase.static ExpressionCreates an expression that converts a string field to lowercase.final ExpressiontoUpper()Creates an expression that converts this string expression to uppercase.static ExpressiontoUpper(Expression string) Creates an expression that converts a string expression to uppercase.static ExpressionCreates an expression that converts a string field to uppercase.final Expressiontrim()Creates an expression that removes leading and trailing whitespace from this string expression.static Expressiontrim(Expression string) Creates an expression that removes leading and trailing whitespace from a string expression.static ExpressionCreates an expression that removes leading and trailing whitespace from a string field.trimValue(Expression characters) Creates an expression that removes specified characters from the beginning and end of this string or blob expression.static ExpressiontrimValue(Expression value, Expression characters) Creates an expression that removes specified characters from the beginning and end of a string or blob.static ExpressiontrimValue(Expression value, String characters) Creates an expression that removes specified characters from the beginning and end of a string or blob.Creates an expression that removes specified characters from the beginning and end of this string or blob expression.static ExpressiontrimValue(String fieldName, Expression characters) Creates an expression that removes specified characters from the beginning and end of a string or blob.static ExpressionCreates an expression that removes specified characters from the beginning and end of a string or blob.final Expressiontrunc()Creates an expression that truncates this numeric expression to an integer.static Expressiontrunc(Expression numericExpr) Creates an expression that truncatesnumericExprto an integer.static ExpressionCreates an expression that truncatesnumericFieldto an integer.final ExpressiontruncToPrecision(int decimalPlace) Creates an expression that truncates this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.final ExpressiontruncToPrecision(Expression decimalPlace) Creates an expression that truncates this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressiontruncToPrecision(Expression numericExpr, int decimalPlace) Creates an expression that truncatesnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressiontruncToPrecision(Expression numericExpr, Expression decimalPlace) Creates an expression that truncatesnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressiontruncToPrecision(String numericField, int decimalPlace) Creates an expression that truncatesnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.static ExpressiontruncToPrecision(String numericField, Expression decimalPlace) Creates an expression that truncatesnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.final Expressiontype()Creates an expression that returns a string indicating the type of the value this expression evaluates to.static Expressiontype(Expression expr) Creates an expression that returns a string indicating the type of the value this expression evaluates to.static ExpressionCreates an expression that returns a string indicating the type of the value this field evaluates to.final ExpressionCreates 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.static ExpressionCreates an expression that converts a Unix timestamp in microseconds to a Firestore timestamp.static ExpressionunixMicrosToTimestamp(String fieldName) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.final ExpressionCreates 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.static ExpressionCreates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.static ExpressionunixMillisToTimestamp(String fieldName) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.final ExpressionCreates 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.static ExpressionCreates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.static ExpressionunixSecondsToTimestamp(String fieldName) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.static ExpressionCreates an expression that retrieves the value of a variable bound viaPipeline.define(AliasedExpression, AliasedExpression...).final ExpressionCreates an expression that calculates the length (dimension) of a Firestore Vector.static ExpressionvectorLength(Expression vectorExpression) Creates an expression that calculates the length of a vector.static ExpressionvectorLength(String fieldName) Creates an expression that calculates the length of a vector.static BooleanExpressionxor(BooleanExpression condition, BooleanExpression... conditions) Creates an expression that performs a logical 'XOR' operation.
-
Method Details
-
constant
Create a constant for aStringvalue.- Parameters:
value- TheStringvalue.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for aNumbervalue.- Parameters:
value- TheNumbervalue.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for aDatevalue.- Parameters:
value- TheDatevalue.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for aTimestampvalue.- Parameters:
value- TheTimestampvalue.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for aBooleanvalue.- Parameters:
value- TheBooleanvalue.- Returns:
- A new
BooleanExpressionconstant instance.
-
constant
Create a constant for aGeoPointvalue.- Parameters:
value- TheGeoPointvalue.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for aBlobvalue.- Parameters:
value- TheBlobvalue.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for aDocumentReferencevalue.- Parameters:
value- TheDocumentReferencevalue.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for a bytes value.- Parameters:
value- The bytes value.- Returns:
- A new
Expressionconstant instance.
-
constant
Create a constant for aVectorValuevalue.- Parameters:
value- TheVectorValuevalue.- Returns:
- A new
Expressionconstant instance.
-
nullValue
Constant for a null value.- Returns:
- An
Expressionconstant instance.
-
field
Creates aFieldinstance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city").
- Parameters:
path- The path to the field.- Returns:
- A new
Fieldinstance representing the specified path.
-
field
Creates aFieldinstance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city").
-
currentTimestamp
Creates an expression that returns the current timestamp.- Returns:
- A new
Expressionrepresenting the current timestamp.
-
ifAbsent
Creates an expression that returns a default value if an expression evaluates to an absent value.- Parameters:
ifExpr- The expression to check.elseExpr- The default value.- Returns:
- A new
Expressionrepresenting the ifAbsent operation.
-
ifAbsent
Creates an expression that returns a default value if an expression evaluates to an absent value.- Parameters:
ifExpr- The expression to check.elseValue- The default value.- Returns:
- A new
Expressionrepresenting the ifAbsent operation.
-
ifAbsent
Creates an expression that returns a default value if a field is absent.- Parameters:
ifFieldName- The field to check.elseExpr- The default value.- Returns:
- A new
Expressionrepresenting the ifAbsent operation.
-
ifAbsent
Creates an expression that returns a default value if a field is absent.- Parameters:
ifFieldName- The field to check.elseValue- The default value.- Returns:
- A new
Expressionrepresenting the ifAbsent operation.
-
ifNull
Creates an expression that returns a default value if an expression evaluates to null.Note: This function provides a fallback for both absent and explicit null values. In contrast,
ifAbsent(com.google.cloud.firestore.pipeline.expressions.Expression,com.google.cloud.firestore.pipeline.expressions.Expression)only triggers for missing fields.- Parameters:
ifExpr- The expression to check.elseExpression- The default expression that will be evaluated and returned.- Returns:
- A new
Expressionrepresenting the ifNull operation.
-
ifNull
Creates an expression that returns a default value if an expression evaluates to null.Note: This function provides a fallback for both absent and explicit null values. In contrast,
ifAbsent(com.google.cloud.firestore.pipeline.expressions.Expression,com.google.cloud.firestore.pipeline.expressions.Expression)only triggers for missing fields.- Parameters:
ifExpr- The expression to check.elseValue- The default value that will be returned.- Returns:
- A new
Expressionrepresenting the ifNull operation.
-
ifNull
Creates an expression that returns a default value if a field is null.Note: This function provides a fallback for both absent and explicit null values. In contrast,
ifAbsent(com.google.cloud.firestore.pipeline.expressions.Expression,com.google.cloud.firestore.pipeline.expressions.Expression)only triggers for missing fields.- Parameters:
ifFieldName- The field to check.elseExpression- The default expression that will be evaluated and returned.- Returns:
- A new
Expressionrepresenting the ifNull operation.
-
ifNull
Creates an expression that returns a default value if a field is null.Note: This function provides a fallback for both absent and explicit null values. In contrast,
ifAbsent(com.google.cloud.firestore.pipeline.expressions.Expression,com.google.cloud.firestore.pipeline.expressions.Expression)only triggers for missing fields.- Parameters:
ifFieldName- The field to check.elseValue- The default value that will be returned.- Returns:
- A new
Expressionrepresenting the ifNull operation.
-
coalesce
Returns the first non-null, non-absent argument, without evaluating the rest of the arguments. When all arguments are null or absent, returns the last argument.- Parameters:
expression- The first expression to check for null.replacement- The fallback expression or value if the first one is null.others- Optional additional expressions to check if previous ones are null.- Returns:
- A new
Expressionrepresenting the coalesce operation.
-
coalesce
Returns the first non-null, non-absent argument, without evaluating the rest of the arguments. When all arguments are null or absent, returns the last argument.- Parameters:
firstFieldName- The name of the first field to check for null.replacement- The fallback expression or value if the first one is null.others- Optional additional expressions to check if previous ones are null.- Returns:
- A new
Expressionrepresenting the coalesce operation.
-
join
Creates an expression that joins the elements of an array into a string.- Parameters:
arrayExpression- The expression representing the array.delimiter- The delimiter to use.- Returns:
- A new
Expressionrepresenting the join operation.
-
join
Creates an expression that joins the elements of an array into a string.- Parameters:
arrayExpression- The expression representing the array.delimiterExpression- The expression representing the delimiter.- Returns:
- A new
Expressionrepresenting the join operation.
-
join
Creates an expression that joins the elements of an array into a string.- Parameters:
arrayFieldName- The field name of the array.delimiter- The delimiter to use.- Returns:
- A new
Expressionrepresenting the join operation.
-
join
Creates an expression that joins the elements of an array into a string.- Parameters:
arrayFieldName- The field name of the array.delimiterExpression- The expression representing the delimiter.- Returns:
- A new
Expressionrepresenting the join operation.
-
rawExpression
Creates a generic function expression that is not yet implemented.- Parameters:
name- The name of the generic function.expr- The expressions to be passed as arguments to the function.- Returns:
- A new
Expressionrepresenting the generic function.
-
and
Creates an expression that performs a logical 'AND' operation.- Parameters:
condition- The firstBooleanExpression.conditions- AdditionalBooleanExpressions.- Returns:
- A new
BooleanExpressionrepresenting the logical 'AND' operation.
-
or
Creates an expression that performs a logical 'OR' operation.- Parameters:
condition- The firstBooleanExpression.conditions- AdditionalBooleanExpressions.- Returns:
- A new
BooleanExpressionrepresenting the logical 'OR' operation.
-
nor
Creates an expression that performs a logical 'NOR' operation.- Parameters:
condition- The firstBooleanExpression.conditions- AdditionalBooleanExpressions.- Returns:
- A new
BooleanExpressionrepresenting the logical 'NOR' operation.
-
switchOn
Creates an expression that evaluates to the result corresponding to the first true condition.This function behaves like a `switch` statement. It accepts an alternating sequence of conditions and their corresponding results. If an odd number of arguments is provided, the final argument serves as a default fallback result. If no default is provided and no condition evaluates to true, it throws an error.
- Parameters:
condition- The firstBooleanExpression.result- The result if the first condition is true.others- Additional conditions and results, and optionally a default value.- Returns:
- A new
Expressionrepresenting the switchOn operation.
-
xor
Creates an expression that performs a logical 'XOR' operation.- Parameters:
condition- The firstBooleanExpression.conditions- AdditionalBooleanExpressions.- Returns:
- A new
BooleanExpressionrepresenting the logical 'XOR' operation.
-
not
Creates an expression that negates a boolean expression.- Parameters:
condition- The boolean expression to negate.- Returns:
- A new
BooleanExpressionrepresenting the not operation.
-
add
Creates an expression that adds numeric expressions.- Parameters:
first- Numeric expression to add.second- Numeric expression to add.- Returns:
- A new
Expressionrepresenting the addition operation.
-
add
Creates an expression that adds numeric expressions with a constant.- Parameters:
first- Numeric expression to add.second- Constant to add.- Returns:
- A new
Expressionrepresenting the addition operation.
-
add
Creates an expression that adds a numeric field with a numeric expression.- Parameters:
fieldName- Numeric field to add.second- Numeric expression to add to field value.- Returns:
- A new
Expressionrepresenting the addition operation.
-
add
Creates an expression that adds a numeric field with constant.- Parameters:
fieldName- Numeric field to add.second- Constant to add.- Returns:
- A new
Expressionrepresenting the addition operation.
-
subtract
Creates an expression that subtracts two expressions.- Parameters:
minuend- Numeric expression to subtract from.subtrahend- Numeric expression to subtract.- Returns:
- A new
Expressionrepresenting the subtract operation.
-
subtract
Creates an expression that subtracts a constant value from a numeric expression.- Parameters:
minuend- Numeric expression to subtract from.subtrahend- Constant to subtract.- Returns:
- A new
Expressionrepresenting the subtract operation.
-
subtract
Creates an expression that subtracts a numeric expressions from numeric field.- Parameters:
fieldName- Numeric field to subtract from.subtrahend- Numeric expression to subtract.- Returns:
- A new
Expressionrepresenting the subtract operation.
-
subtract
Creates an expression that subtracts a constant from numeric field.- Parameters:
fieldName- Numeric field to subtract from.subtrahend- Constant to subtract.- Returns:
- A new
Expressionrepresenting the subtract operation.
-
multiply
Creates an expression that multiplies numeric expressions.- Parameters:
first- Numeric expression to multiply.second- Numeric expression to multiply.- Returns:
- A new
Expressionrepresenting the multiplication operation.
-
multiply
Creates an expression that multiplies numeric expressions with a constant.- Parameters:
first- Numeric expression to multiply.second- Constant to multiply.- Returns:
- A new
Expressionrepresenting the multiplication operation.
-
multiply
Creates an expression that multiplies a numeric field with a numeric expression.- Parameters:
fieldName- Numeric field to multiply.second- Numeric expression to multiply.- Returns:
- A new
Expressionrepresenting the multiplication operation.
-
multiply
Creates an expression that multiplies a numeric field with a constant.- Parameters:
fieldName- Numeric field to multiply.second- Constant to multiply.- Returns:
- A new
Expressionrepresenting the multiplication operation.
-
divide
Creates an expression that divides two numeric expressions.- Parameters:
dividend- The numeric expression to be divided.divisor- The numeric expression to divide by.- Returns:
- A new
Expressionrepresenting the division operation.
-
divide
Creates an expression that divides a numeric expression by a constant.- Parameters:
dividend- The numeric expression to be divided.divisor- The constant to divide by.- Returns:
- A new
Expressionrepresenting the division operation.
-
divide
Creates an expression that divides numeric field by a numeric expression.- Parameters:
fieldName- The numeric field name to be divided.divisor- The numeric expression to divide by.- Returns:
- A new
Expressionrepresenting the divide operation.
-
divide
Creates an expression that divides a numeric field by a constant.- Parameters:
fieldName- The numeric field name to be divided.divisor- The constant to divide by.- Returns:
- A new
Expressionrepresenting the divide operation.
-
mod
Creates an expression that calculates the modulo (remainder) of dividing two numeric expressions.- Parameters:
dividend- The numeric expression to be divided.divisor- The numeric expression to divide by.- Returns:
- A new
Expressionrepresenting the modulo operation.
-
mod
Creates an expression that calculates the modulo (remainder) of dividing a numeric expression by a constant.- Parameters:
dividend- The numeric expression to be divided.divisor- The constant to divide by.- Returns:
- A new
Expressionrepresenting the modulo operation.
-
mod
Creates an expression that calculates the modulo (remainder) of dividing a numeric field by a constant.- Parameters:
fieldName- The numeric field name to be divided.divisor- The numeric expression to divide by.- Returns:
- A new
Expressionrepresenting the modulo operation.
-
mod
Creates an expression that calculates the modulo (remainder) of dividing a numeric field by a constant.- Parameters:
fieldName- The numeric field name to be divided.divisor- The constant to divide by.- Returns:
- A new
Expressionrepresenting the modulo operation.
-
equal
Creates an expression that checks if two expressions are equal.- Parameters:
left- The first expression.right- The second expression.- Returns:
- A new
BooleanExpressionrepresenting the equality comparison.
-
equal
Creates an expression that checks if an expression is equal to a constant value.- Parameters:
left- The expression.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the equality comparison.
-
equal
Creates an expression that checks if a field is equal to an expression.- Parameters:
fieldName- The field name.right- The expression.- Returns:
- A new
BooleanExpressionrepresenting the equality comparison.
-
equal
Creates an expression that checks if a field is equal to a constant value.- Parameters:
fieldName- The field name.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the equality comparison.
-
notEqual
Creates an expression that checks if two expressions are not equal.- Parameters:
left- The first expression.right- The second expression.- Returns:
- A new
BooleanExpressionrepresenting the inequality comparison.
-
notEqual
Creates an expression that checks if an expression is not equal to a constant value.- Parameters:
left- The expression.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the inequality comparison.
-
notEqual
Creates an expression that checks if a field is not equal to an expression.- Parameters:
fieldName- The field name.right- The expression.- Returns:
- A new
BooleanExpressionrepresenting the inequality comparison.
-
notEqual
Creates an expression that checks if a field is not equal to a constant value.- Parameters:
fieldName- The field name.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the inequality comparison.
-
greaterThan
Creates an expression that checks if the first expression is greater than the second expression.- Parameters:
left- The first expression.right- The second expression.- Returns:
- A new
BooleanExpressionrepresenting the greater than comparison.
-
greaterThan
Creates an expression that checks if an expression is greater than a constant value.- Parameters:
left- The expression.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the greater than comparison.
-
greaterThan
Creates an expression that checks if a field is greater than an expression.- Parameters:
fieldName- The field name.right- The expression.- Returns:
- A new
BooleanExpressionrepresenting the greater than comparison.
-
greaterThan
Creates an expression that checks if a field is greater than a constant value.- Parameters:
fieldName- The field name.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the greater than comparison.
-
greaterThanOrEqual
Creates an expression that checks if the first expression is greater than or equal to the second expression.- Parameters:
left- The first expression.right- The second expression.- Returns:
- A new
BooleanExpressionrepresenting the greater than or equal to comparison.
-
greaterThanOrEqual
Creates an expression that checks if an expression is greater than or equal to a constant value.- Parameters:
left- The expression.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the greater than or equal to comparison.
-
greaterThanOrEqual
Creates an expression that checks if a field is greater than or equal to an expression.- Parameters:
fieldName- The field name.right- The expression.- Returns:
- A new
BooleanExpressionrepresenting the greater than or equal to comparison.
-
greaterThanOrEqual
Creates an expression that checks if a field is greater than or equal to a constant value.- Parameters:
fieldName- The field name.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the greater than or equal to comparison.
-
lessThan
Creates an expression that checks if the first expression is less than the second expression.- Parameters:
left- The first expression.right- The second expression.- Returns:
- A new
BooleanExpressionrepresenting the less than comparison.
-
lessThan
Creates an expression that checks if an expression is less than a constant value.- Parameters:
left- The expression.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the less than comparison.
-
lessThan
Creates an expression that checks if a field is less than an expression.- Parameters:
fieldName- The field name.right- The expression.- Returns:
- A new
BooleanExpressionrepresenting the less than comparison.
-
lessThan
Creates an expression that checks if a field is less than a constant value.- Parameters:
fieldName- The field name.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the less than comparison.
-
lessThanOrEqual
Creates an expression that checks if the first expression is less than or equal to the second expression.- Parameters:
left- The first expression.right- The second expression.- Returns:
- A new
BooleanExpressionrepresenting the less than or equal to comparison.
-
lessThanOrEqual
Creates an expression that checks if an expression is less than or equal to a constant value.- Parameters:
left- The expression.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the less than or equal to comparison.
-
lessThanOrEqual
Creates an expression that checks if a field is less than or equal to an expression.- Parameters:
fieldName- The field name.right- The expression.- Returns:
- A new
BooleanExpressionrepresenting the less than or equal to comparison.
-
lessThanOrEqual
Creates an expression that checks if a field is less than or equal to a constant value.- Parameters:
fieldName- The field name.right- The constant value.- Returns:
- A new
BooleanExpressionrepresenting the less than or equal to comparison.
-
equalAny
Creates an expression that checks if anexpression, when evaluated, is equal to any of the providedvalues.- Parameters:
expression- The expression whose results to compare.values- The values to check against.- Returns:
- A new
BooleanExpressionrepresenting the 'IN' comparison.
-
equalAny
Creates an expression that checks if anexpression, when evaluated, is equal to any of the elements ofarrayExpression.- Parameters:
expression- The expression whose results to compare.arrayExpression- An expression that evaluates to an array, whose elements to check for equality to the input.- Returns:
- A new
BooleanExpressionrepresenting the 'IN' comparison.
-
equalAny
Creates an expression that checks if a field's value is equal to any of the providedvalues.- Parameters:
fieldName- The field to compare.values- The values to check against.- Returns:
- A new
BooleanExpressionrepresenting the 'IN' comparison.
-
equalAny
Creates an expression that checks if a field's value is equal to any of the elements ofarrayExpression.- Parameters:
fieldName- The field to compare.arrayExpression- An expression that evaluates to an array, whose elements to check for equality to the input.- Returns:
- A new
BooleanExpressionrepresenting the 'IN' comparison.
-
notEqualAny
Creates an expression that checks if anexpression, when evaluated, is not equal to all the providedvalues.- Parameters:
expression- The expression whose results to compare.values- The values to check against.- Returns:
- A new
BooleanExpressionrepresenting the 'NOT IN' comparison.
-
notEqualAny
Creates an expression that checks if anexpression, when evaluated, is not equal to all the elements ofarrayExpression.- Parameters:
expression- The expression whose results to compare.arrayExpression- An expression that evaluates to an array, whose elements to check for equality to the input.- Returns:
- A new
BooleanExpressionrepresenting the 'NOT IN' comparison.
-
notEqualAny
Creates an expression that checks if a field's value is not equal to all of the providedvalues.- Parameters:
fieldName- The field to compare.values- The values to check against.- Returns:
- A new
BooleanExpressionrepresenting the 'NOT IN' comparison.
-
notEqualAny
Creates an expression that checks if a field's value is not equal to all of the elements ofarrayExpression.- Parameters:
fieldName- The field to compare.arrayExpression- An expression that evaluates to an array, whose elements to check for equality to the input.- Returns:
- A new
BooleanExpressionrepresenting the 'NOT IN' comparison.
-
charLength
Creates an expression that calculates the character length of a string expression in UTF8.- Parameters:
string- The expression representing the string.- Returns:
- A new
Expressionrepresenting the charLength operation.
-
charLength
Creates an expression that calculates the character length of a string field in UTF8.- Parameters:
fieldName- The name of the field containing the string.- Returns:
- A new
Expressionrepresenting the charLength operation.
-
byteLength
Creates an expression that calculates the length of a string in UTF-8 bytes, or just the length of a Blob.- Parameters:
string- The expression representing the string.- Returns:
- A new
Expressionrepresenting the length of the string in bytes.
-
byteLength
Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.- Parameters:
fieldName- The name of the field containing the string.- Returns:
- A new
Expressionrepresenting the length of the string in bytes.
-
length
Creates an expression that calculates the length of string, array, map, vector, or Blob.- Parameters:
string- The expression representing the value to calculate the length of.- Returns:
- A new
Expressionrepresenting the length of the value.
-
length
Creates an expression that calculates the length of string, array, map, vector, or Blob.- Parameters:
fieldName- The name of the field containing the value.- Returns:
- A new
Expressionrepresenting the length of the value.
-
like
Creates an expression that performs a case-sensitive wildcard string comparison.- Parameters:
string- The expression representing the string to perform the comparison on.pattern- The pattern to search for. You can use "%" as a wildcard character.- Returns:
- A new
BooleanExpressionrepresenting the like operation.
-
like
Creates an expression that performs a case-sensitive wildcard string comparison.- Parameters:
string- The expression representing the string to perform the comparison on.pattern- The pattern to search for. You can use "%" as a wildcard character.- Returns:
- A new
BooleanExpressionrepresenting the like operation.
-
like
Creates an expression that performs a case-sensitive wildcard string comparison against a field.- Parameters:
fieldName- The name of the field containing the string.pattern- The pattern to search for. You can use "%" as a wildcard character.- Returns:
- A new
BooleanExpressionrepresenting the like comparison.
-
like
Creates an expression that performs a case-sensitive wildcard string comparison against a field.- Parameters:
fieldName- The name of the field containing the string.pattern- The pattern to search for. You can use "%" as a wildcard character.- Returns:
- A new
BooleanExpressionrepresenting the like comparison.
-
regexContains
Creates an expression that checks if a string expression contains a specified regular expression as a substring.- Parameters:
string- The expression representing the string to perform the comparison on.pattern- The regular expression to use for the search.- Returns:
- A new
BooleanExpressionrepresenting the contains regular expression comparison.
-
regexContains
Creates an expression that checks if a string expression contains a specified regular expression as a substring.- Parameters:
string- The expression representing the string to perform the comparison on.pattern- The regular expression to use for the search.- Returns:
- A new
BooleanExpressionrepresenting the contains regular expression comparison.
-
regexContains
Creates an expression that checks if a string field contains a specified regular expression as a substring.- Parameters:
fieldName- The name of the field containing the string.pattern- The regular expression to use for the search.- Returns:
- A new
BooleanExpressionrepresenting the contains regular expression comparison.
-
regexContains
Creates an expression that checks if a string field contains a specified regular expression as a substring.- Parameters:
fieldName- The name of the field containing the string.pattern- The regular expression to use for the search.- Returns:
- A new
BooleanExpressionrepresenting the contains regular expression comparison.
-
regexFind
Creates an expression that returns the first substring of a string expression that matches a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
string- The expression representing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionrepresenting the regular expression find function.
-
regexFind
Creates an expression that returns the first substring of a string expression that matches a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
string- The expression representing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionrepresenting the regular expression find function.
-
regexFind
Creates an expression that returns the first substring of a string field that matches a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
fieldName- The name of the field containing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionrepresenting the regular expression find function.
-
regexFind
Creates an expression that returns the first substring of a string field that matches a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
fieldName- The name of the field containing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionrepresenting the regular expression find function.
-
regexFindAll
Creates an expression that evaluates to a list of all substrings in a string expression that match a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
string- The expression representing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionthat evaluates to a list of matched substrings.
-
regexFindAll
Creates an expression that evaluates to a list of all substrings in a string expression that match a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
string- The expression representing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionthat evaluates to a list of matched substrings.
-
regexFindAll
Creates an expression that evaluates to a list of all substrings in a string field that match a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
fieldName- The name of the field containing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionthat evaluates to a list of matched substrings.
-
regexFindAll
Creates an expression that evaluates to a list of all substrings in a string field that match a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
fieldName- The name of the field containing the string to search.pattern- The regular expression to search for.- Returns:
- A new
Expressionthat evaluates to a list of matched substrings.
-
regexMatch
Creates an expression that checks if a string field matches a specified regular expression.- Parameters:
string- The expression representing the string to match against.pattern- The regular expression to use for the match.- Returns:
- A new
BooleanExpressionrepresenting the regular expression match comparison.
-
regexMatch
Creates an expression that checks if a string field matches a specified regular expression.- Parameters:
string- The expression representing the string to match against.pattern- The regular expression to use for the match.- Returns:
- A new
BooleanExpressionrepresenting the regular expression match comparison.
-
regexMatch
Creates an expression that checks if a string field matches a specified regular expression.- Parameters:
fieldName- The name of the field containing the string.pattern- The regular expression to use for the match.- Returns:
- A new
BooleanExpressionrepresenting the regular expression match comparison.
-
regexMatch
Creates an expression that checks if a string field matches a specified regular expression.- Parameters:
fieldName- The name of the field containing the string.pattern- The regular expression to use for the match.- Returns:
- A new
BooleanExpressionrepresenting the regular expression match comparison.
-
stringContains
Creates an expression that checks if a string expression contains a specified substring.- Parameters:
string- The expression representing the string to perform the comparison on.substring- The expression representing the substring to search for.- Returns:
- A new
BooleanExpressionrepresenting the contains comparison.
-
stringContains
Creates an expression that checks if a string expression contains a specified substring.- Parameters:
string- The expression representing the string to perform the comparison on.substring- The substring to search for.- Returns:
- A new
BooleanExpressionrepresenting the contains comparison.
-
stringContains
Creates an expression that checks if a string field contains a specified substring.- Parameters:
fieldName- The name of the field to perform the comparison on.substring- The expression representing the substring to search for.- Returns:
- A new
BooleanExpressionrepresenting the contains comparison.
-
stringContains
Creates an expression that checks if a string field contains a specified substring.- Parameters:
fieldName- The name of the field to perform the comparison on.substring- The substring to search for.- Returns:
- A new
BooleanExpressionrepresenting the contains comparison.
-
startsWith
Creates an expression that checks if a string expression starts with a givenprefix.- Parameters:
string- The expression to check.prefix- The prefix string expression to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'starts with' comparison.
-
startsWith
Creates an expression that checks if a string expression starts with a givenprefix.- Parameters:
string- The expression to check.prefix- The prefix string to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'starts with' comparison.
-
startsWith
Creates an expression that checks if a string expression starts with a givenprefix.- Parameters:
fieldName- The name of field that contains a string to check.prefix- The prefix string expression to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'starts with' comparison.
-
startsWith
Creates an expression that checks if a string expression starts with a givenprefix.- Parameters:
fieldName- The name of field that contains a string to check.prefix- The prefix string to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'starts with' comparison.
-
endsWith
Creates an expression that checks if a string expression ends with a givensuffix.- Parameters:
string- The expression to check.suffix- The suffix string expression to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'ends with' comparison.
-
endsWith
Creates an expression that checks if a string expression ends with a givensuffix.- Parameters:
string- The expression to check.suffix- The suffix string to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'ends with' comparison.
-
endsWith
Creates an expression that checks if a string expression ends with a givensuffix.- Parameters:
fieldName- The name of field that contains a string to check.suffix- The suffix string expression to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'ends with' comparison.
-
endsWith
Creates an expression that checks if a string expression ends with a givensuffix.- Parameters:
fieldName- The name of field that contains a string to check.suffix- The suffix string to check for.- Returns:
- A new
BooleanExpressionrepresenting the 'ends with' comparison.
-
substring
Creates an expression that returns a substring of the given string.- Parameters:
string- The expression representing the string to get a substring from.index- The starting index of the substring.length- The length of the substring.- Returns:
- A new
Expressionrepresenting the substring.
-
substring
Creates an expression that returns a substring of the given string.- Parameters:
fieldName- The name of the field containing the string to get a substring from.index- The starting index of the substring.length- The length of the substring.- Returns:
- A new
Expressionrepresenting the substring.
-
toLower
Creates an expression that converts a string expression to lowercase.- Parameters:
string- The expression representing the string to convert to lowercase.- Returns:
- A new
Expressionrepresenting the lowercase string.
-
toLower
Creates an expression that converts a string field to lowercase.- Parameters:
fieldName- The name of the field containing the string to convert to lowercase.- Returns:
- A new
Expressionrepresenting the lowercase string.
-
toUpper
Creates an expression that converts a string expression to uppercase.- Parameters:
string- The expression representing the string to convert to uppercase.- Returns:
- A new
Expressionrepresenting the lowercase string.
-
toUpper
Creates an expression that converts a string field to uppercase.- Parameters:
fieldName- The name of the field containing the string to convert to uppercase.- Returns:
- A new
Expressionrepresenting the lowercase string.
-
trim
Creates an expression that removes leading and trailing whitespace from a string expression.- Parameters:
string- The expression representing the string to trim.- Returns:
- A new
Expressionrepresenting the trimmed string.
-
trim
Creates an expression that removes leading and trailing whitespace from a string field.- Parameters:
fieldName- The name of the field containing the string to trim.- Returns:
- A new
Expressionrepresenting the trimmed string.
-
trimValue
Creates an expression that removes specified characters from the beginning and end of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
trimValue
Creates an expression that removes specified characters from the beginning and end of a string or blob.- Parameters:
fieldName- The name of the field containing the string or blob to trim.characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
trimValue
Creates an expression that removes specified characters from the beginning and end of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.characters- The expression representing the characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
trimValue
Creates an expression that removes specified characters from the beginning and end of a string or blob.- Parameters:
fieldName- The name of the field containing the string or blob to trim.characters- The expression representing the characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrim
Creates an expression that removes whitespace from the beginning of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrim
Creates an expression that removes whitespace from the beginning of a string or blob.- Parameters:
fieldName- The name of the field containing the string or blob to trim.- Returns:
- A new
Expressionrepresenting the trimmed string.
-
ltrimValue
Creates an expression that removes specified characters from the beginning of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrimValue
Creates an expression that removes specified characters from the beginning of a string or blob.- Parameters:
fieldName- The name of the field containing the string or blob to trim.characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrimValue
Creates an expression that removes specified characters from the beginning of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.characters- The expression representing the characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrimValue
Creates an expression that removes specified characters from the beginning of a string or blob.- Parameters:
fieldName- The name of the field containing the string or blob to trim.characters- The expression representing the characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrim
Creates an expression that removes whitespace from the end of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrim
Creates an expression that removes whitespace from the end of a string or blob.- Parameters:
fieldName- The name of the field containing the string to trim.- Returns:
- A new
Expressionrepresenting the trimmed string.
-
rtrimValue
Creates an expression that removes specified characters from the end of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrimValue
Creates an expression that removes specified characters from the end of a string or blob.- Parameters:
fieldName- The name of the field containing the string or blob to trim.characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrimValue
Creates an expression that removes specified characters from the end of a string or blob.- Parameters:
value- The expression representing the string or blob to trim.characters- The expression representing the characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrimValue
Creates an expression that removes specified characters from the end of a string or blob.- Parameters:
fieldName- The name of the field containing the string or blob to trim.characters- The expression representing the characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
stringRepeat
Creates an expression that repeats a string or blob a specified number of times.- Parameters:
value- The expression representing the string or blob to repeat.repetitions- The number of times to repeat the string or blob.- Returns:
- A new
Expressionrepresenting the repeated string or blob.
-
stringRepeat
Creates an expression that repeats a string or blob a specified number of times.- Parameters:
fieldName- The name of the field containing the string or blob to repeat.repetitions- The number of times to repeat the string or blob.- Returns:
- A new
Expressionrepresenting the repeated string or blob.
-
stringRepeat
Creates an expression that repeats a string or blob a specified number of times.- Parameters:
value- The expression representing the string or blob to repeat.repetitions- The expression representing the number of times to repeat.- Returns:
- A new
Expressionrepresenting the repeated string or blob.
-
stringRepeat
Creates an expression that repeats a string or blob a specified number of times.- Parameters:
fieldName- The name of the field containing the string or blob to repeat.repetitions- The expression representing the number of times to repeat.- Returns:
- A new
Expressionrepresenting the repeated string or blob.
-
stringReplaceAll
Creates an expression that replaces all occurrences of a substring or byte sequence.- Parameters:
value- The expression representing the input string or blob.find- The match pattern.replacement- The replacement string/bytes.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceAll
Creates an expression that replaces all occurrences of a substring or byte sequence.- Parameters:
fieldName- The name of the field containing the input string or blob.find- The match pattern.replacement- The replacement string/bytes.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceAll
public static Expression stringReplaceAll(Expression value, Expression find, Expression replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.- Parameters:
value- The expression representing the input string or blob.find- The expression representing the match pattern.replacement- The expression representing the replacement value.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceAll
public static Expression stringReplaceAll(String fieldName, Expression find, Expression replacement) Creates an expression that replaces all occurrences of a substring or byte sequence.- Parameters:
fieldName- The name of the field containing the input string or blob.find- The expression representing the match pattern.replacement- The expression representing the replacement value.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceOne
Creates an expression that replaces the first occurrence of a substring or byte sequence.- Parameters:
value- The expression representing the input string or blob.find- The match pattern.replacement- The replacement string/bytes.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceOne
Creates an expression that replaces the first occurrence of a substring or byte sequence.- Parameters:
fieldName- The name of the field containing the input string or blob.find- The match pattern.replacement- The replacement string/bytes.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceOne
public static Expression stringReplaceOne(Expression value, Expression find, Expression replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.- Parameters:
value- The expression representing the input string or blob.find- The expression representing the match pattern.replacement- The expression representing the replacement value.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceOne
public static Expression stringReplaceOne(String fieldName, Expression find, Expression replacement) Creates an expression that replaces the first occurrence of a substring or byte sequence.- Parameters:
fieldName- The name of the field containing the input string or blob.find- The expression representing the match pattern.replacement- The expression representing the replacement value.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringIndexOf
Creates an expression that returns the index of the first occurrence of a substring or bytes.- Parameters:
value- The expression representing the input string or blob.search- The search pattern.- Returns:
- A new
Expressionrepresenting the index.
-
stringIndexOf
Creates an expression that returns the index of the first occurrence of a substring or bytes.- Parameters:
fieldName- The name of the field containing the input string or blob.search- The search pattern.- Returns:
- A new
Expressionrepresenting the index.
-
stringIndexOf
Creates an expression that returns the index of the first occurrence of a substring or bytes.- Parameters:
value- The expression representing the input string or blob.search- The expression representing the search pattern.- Returns:
- A new
Expressionrepresenting the index.
-
stringIndexOf
Creates an expression that returns the index of the first occurrence of a substring or bytes.- Parameters:
fieldName- The name of the field containing the input string or blob.search- The expression representing the search pattern.- Returns:
- A new
Expressionrepresenting the index.
-
split
Creates an expression that splits a string or blob by a delimiter.- Parameters:
value- The expression representing the string or blob to split.delimiter- The delimiter to split by.- Returns:
- A new
Expressionrepresenting the split string or blob as an array.
-
split
Creates an expression that splits a string or blob by a delimiter.- Parameters:
value- The expression representing the string or blob to split.delimiter- The delimiter to split by.- Returns:
- A new
Expressionrepresenting the split string or blob as an array.
-
split
Creates an expression that splits a string or blob by a delimiter.- Parameters:
fieldName- The name of the field containing the string or blob to split.delimiter- The delimiter to split by.- Returns:
- A new
Expressionrepresenting the split string or blob as an array.
-
split
Creates an expression that splits a string or blob by a delimiter.- Parameters:
fieldName- The name of the field containing the string or blob to split.delimiter- The delimiter to split by.- Returns:
- A new
Expressionrepresenting the split string or blob as an array.
-
stringConcat
Creates an expression that concatenates string expressions together.- Parameters:
firstString- The expression representing the initial string value.otherStrings- Optional additional string expressions or string constants to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated string.
-
stringConcat
Creates an expression that concatenates string expressions together.- Parameters:
fieldName- The field name containing the initial string value.otherStrings- Optional additional string expressions or string constants to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated string.
-
concat
Creates an expression that concatenates expressions together.- Parameters:
first- The expression representing the initial value.others- Optional additional expressions or constants to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated value.
-
concat
Creates an expression that concatenates expressions together.- Parameters:
fieldName- The field name containing the initial value.others- Optional additional expressions or constants to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated value.
-
map
Creates an expression that creates a Firestore map value from an input object.- Parameters:
elements- The input map to evaluate in the expression.- Returns:
- A new
Expressionrepresenting the map function.
-
mapGet
Accesses a value from a map (object) field using the providedkeyExpression.- Parameters:
map- The expression representing the map.key- The key to access in the map.- Returns:
- A new
Expressionrepresenting the value associated with the given key in the map.
-
mapGet
Accesses a value from a map (object) field using the providedkey.- Parameters:
map- The expression representing the map.key- The key to access in the map.- Returns:
- A new
Expressionrepresenting the value associated with the given key in the map.
-
mapGet
Accesses a value from a map (object) field using the providedkey.- Parameters:
fieldName- The field name of the map field.key- The key to access in the map.- Returns:
- A new
Expressionrepresenting the value associated with the given key in the map.
-
mapGet
Accesses a value from a map (object) field using the providedkeyExpression.- Parameters:
fieldName- The field name of the map field.key- The key to access in the map.- Returns:
- A new
Expressionrepresenting the value associated with the given key in the map.
-
mapMerge
-
mapMerge
-
mapMerge
public static Expression mapMerge(Expression firstMap, Expression secondMap, Expression... otherMaps) Creates an expression that merges multiple maps into a single map. If multiple maps have the same key, the later value is used.- Parameters:
firstMap- First map expression that will be merged.secondMap- Second map expression that will be merged.otherMaps- Additional maps to merge.- Returns:
- A new
Expressionrepresenting the mapMerge operation.
-
mapMerge
public static Expression mapMerge(String firstMapFieldName, Expression secondMap, Expression... otherMaps) Creates an expression that merges multiple maps into a single map. If multiple maps have the same key, the later value is used.- Parameters:
firstMapFieldName- Field name of the first map expression that will be merged.secondMap- Second map expression that will be merged.otherMaps- Additional maps to merge.- Returns:
- A new
Expressionrepresenting the mapMerge operation.
-
mapRemove
Creates an expression that removes a key from a map.- Parameters:
mapExpr- The expression representing the map.key- The key to remove from the map.- Returns:
- A new
Expressionrepresenting the map with the key removed.
-
mapRemove
Creates an expression that removes a key from a map.- Parameters:
mapField- The field name of the map.key- The key to remove from the map.- Returns:
- A new
Expressionrepresenting the map with the key removed.
-
mapRemove
Creates an expression that removes a key from a map.- Parameters:
mapExpr- The expression representing the map.key- The key to remove from the map.- Returns:
- A new
Expressionrepresenting the map with the key removed.
-
mapRemove
Creates an expression that removes a key from a map.- Parameters:
mapField- The field name of the map.key- The key to remove from the map.- Returns:
- A new
Expressionrepresenting the map with the key removed.
-
mapSet
public static Expression mapSet(Expression mapExpr, Expression key, Expression value, Expression... moreKeyValues) Creates an expression that returns a new map with the specified entries added or updated.- Only performs shallow updates to the map.
- Setting a value to
nullwill retain the key with anullvalue. To remove a key entirely, usemapRemove.
- Parameters:
mapExpr- The expression representing the map.key- The key to set. Must be an expression representing a string.value- The value to set.moreKeyValues- Additional key-value pairs to set.- Returns:
- A new
Expressionrepresenting the map with the entries set.
-
mapSet
public static Expression mapSet(Expression mapExpr, String key, Object value, Object... moreKeyValues) Creates an expression that returns a new map with the specified entries added or updated.- Only performs shallow updates to the map.
- Setting a value to
nullwill retain the key with anullvalue. To remove a key entirely, usemapRemove.
- Parameters:
mapExpr- The map field to set entries in.key- The key to set.value- The value to set.moreKeyValues- Additional key-value pairs to set.- Returns:
- A new
Expressionrepresenting the map with the entries set.
-
mapSet
public static Expression mapSet(String mapField, Expression key, Expression value, Expression... moreKeyValues) Creates an expression that returns a new map with the specified entries added or updated.- Only performs shallow updates to the map.
- Setting a value to
nullwill retain the key with anullvalue. To remove a key entirely, usemapRemove.
- Parameters:
mapField- The map field to set entries in.key- The key to set. Must be an expression representing a string.value- The value to set.moreKeyValues- Additional key-value pairs to set.- Returns:
- A new
Expressionrepresenting the map with the entries set.
-
mapSet
Creates an expression that returns a new map with the specified entries added or updated.- Only performs shallow updates to the map.
- Setting a value to
nullwill retain the key with anullvalue. To remove a key entirely, usemapRemove.
- Parameters:
mapField- The map field to set entries in.key- The key to set. Must be an expression representing a string.value- The value to set.moreKeyValues- Additional key-value pairs to set.- Returns:
- A new
Expressionrepresenting the map with the entries set.
-
mapKeys
Creates an expression that returns the keys of a map.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Parameters:
mapExpr- The expression representing the map to get the keys of.- Returns:
- A new
Expressionrepresenting the keys of the map.
-
mapKeys
Creates an expression that returns the keys of a map.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Parameters:
mapField- The map field to get the keys of.- Returns:
- A new
Expressionrepresenting the keys of the map.
-
mapValues
Creates an expression that returns the values of a map.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Parameters:
mapExpr- The expression representing the map to get the values of.- Returns:
- A new
Expressionrepresenting the values of the map.
-
mapValues
Creates an expression that returns the values of a map.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Parameters:
mapField- The map field to get the values of.- Returns:
- A new
Expressionrepresenting the values of the map.
-
mapEntries
Creates an expression that returns the entries of a map as an array of maps, where each map contains a "k" property for the key and a "v" property for the value.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Parameters:
mapExpr- The expression representing the map to get the entries of.- Returns:
- A new
Expressionrepresenting the entries of the map.
-
mapEntries
Creates an expression that returns the entries of a map as an array of maps.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Parameters:
mapField- The map field to get the entries of.- Returns:
- A new
Expressionrepresenting the entries of the map.
-
reverse
Creates an expression that reverses a string, blob, or array.- Parameters:
expr- An expression evaluating to a string, blob, or array value, which will be reversed.- Returns:
- A new
Expressionrepresenting the reversed value.
-
reverse
Creates an expression that reverses the field value, which must be a string, blob, or array.- Parameters:
fieldName- A field evaluating to a string, blob, or array value.- Returns:
- A new
Expressionrepresenting the reversed value.
-
array
Creates an expression that creates a Firestore array value from an input object.- Parameters:
elements- The input elements to evaluate in the expression.- Returns:
- A new
Expressionrepresenting the array function.
-
array
Creates an expression that creates a Firestore array value from an input object.- Parameters:
elements- The input elements to evaluate in the expression.- Returns:
- A new
Expressionrepresenting the array function.
-
arrayConcat
Creates an expression that concatenates multiple arrays into a single array.- Parameters:
firstArray- The first array expression to concatenate.otherArrays- Additional arrays to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated array.
-
arrayConcat
Creates an expression that concatenates multiple arrays into a single array.- Parameters:
firstArrayField- The field name of the first array to concatenate.otherArrays- Additional arrays to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated array.
-
arrayReverse
Creates an expression that reverses an array.- Parameters:
array- The expression representing the array to reverse.- Returns:
- A new
Expressionrepresenting the reversed array.
-
arrayReverse
Creates an expression that reverses an array.- Parameters:
arrayFieldName- The field name of the array to reverse.- Returns:
- A new
Expressionrepresenting the reversed array.
-
arrayFilter
Filters an array expression based on a predicate.- Parameters:
array- The expression representing the array to filter.alias- The alias for the current element in the filter expression.filter- The predicate boolean expression used to filter the elements.- Returns:
- A new
Expressionrepresenting the filtered array.
-
arrayFilter
Filters an array field based on a predicate.- Parameters:
arrayFieldName- The field name of the array to filter.alias- The alias for the current element in the filter expression.filter- The predicate boolean expression used to filter the elements.- Returns:
- A new
Expressionrepresenting the filtered array.
-
arrayTransform
public static Expression arrayTransform(Expression array, String elementAlias, Expression transform) Creates an expression that applies a provided transformation to each element in an array.- Parameters:
array- The expression representing the array to transform.elementAlias- The alias for the current element in the transform expression.transform- The expression used to transform the elements.- Returns:
- A new
Expressionrepresenting the transformed array.
-
arrayTransform
public static Expression arrayTransform(String arrayFieldName, String elementAlias, Expression transform) Creates an expression that applies a provided transformation to each element in an array.- Parameters:
arrayFieldName- The field name of the array to transform.elementAlias- The alias for the current element in the transform expression.transform- The expression used to transform the elements.- Returns:
- A new
Expressionrepresenting the transformed array.
-
arrayTransformWithIndex
public static Expression arrayTransformWithIndex(Expression array, String elementAlias, String indexAlias, 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.- Parameters:
array- The expression representing the array to transform.elementAlias- The alias for the current element in the transform expression.indexAlias- The alias for the current index.transform- The expression used to transform the elements.- Returns:
- A new
Expressionrepresenting the transformed array.
-
arrayTransformWithIndex
public static Expression arrayTransformWithIndex(String arrayFieldName, String elementAlias, String indexAlias, 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.- Parameters:
arrayFieldName- The field name of the array to transform.elementAlias- The alias for the current element in the transform expression.indexAlias- The alias for the current index.transform- The expression used to transform the elements.- Returns:
- A new
Expressionrepresenting the transformed array.
-
arraySlice
Creates an expression that returns a slice of an array.- Parameters:
array- The expression representing the array to slice.offset- The starting index.length- The number of elements to return.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySlice
Creates an expression that returns a slice of an array.- Parameters:
array- The expression representing the array to slice.offset- The starting index.length- The number of elements to return.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySlice
Creates an expression that returns a slice of an array.- Parameters:
arrayFieldName- The field name of the array to slice.offset- The starting index.length- The number of elements to return.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySlice
Creates an expression that returns a slice of an array.- Parameters:
arrayFieldName- The field name of the array to slice.offset- The starting index.length- The number of elements to return.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySliceToEnd
Creates an expression that returns a slice of an array to its end.- Parameters:
array- The expression representing the array to slice.offset- The expression representing the starting index.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySliceToEnd
Creates an expression that returns a slice of an array to its end.- Parameters:
array- The expression representing the array to slice.offset- The starting index.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySliceToEnd
Creates an expression that returns a slice of an array to its end.- Parameters:
arrayFieldName- The field name of the array to slice.offset- The starting index.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySliceToEnd
Creates an expression that returns a slice of an array to its end.- Parameters:
arrayFieldName- The field name of the array to slice.offset- The expression representing the starting index.- Returns:
- A new
Expressionrepresenting the array slice.
-
arrayContains
Creates an expression that checks if an array contains a specified element.- Parameters:
array- The expression representing the array.element- The element to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains comparison.
-
arrayContains
Creates an expression that checks if an array contains a specified element.- Parameters:
arrayFieldName- The field name of the array.element- The element to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains comparison.
-
arrayContains
Creates an expression that checks if an array contains a specified element.- Parameters:
array- The expression representing the array.element- The element to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains comparison.
-
arrayContains
Creates an expression that checks if an array contains a specified element.- Parameters:
arrayFieldName- The field name of the array.element- The element to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains comparison.
-
arrayContainsAll
Creates an expression that checks if an array contains all of the provided values.- Parameters:
array- The expression representing the array.values- The values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains all comparison.
-
arrayContainsAll
Creates an expression that checks if an array contains all of the elements of another array.- Parameters:
array- The expression representing the array.arrayExpression- The expression representing the array of values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains all comparison.
-
arrayContainsAll
Creates an expression that checks if an array contains all of the provided values.- Parameters:
arrayFieldName- The field name of the array.values- The values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains all comparison.
-
arrayContainsAll
Creates an expression that checks if an array contains all of the elements of another array.- Parameters:
arrayFieldName- The field name of the array.arrayExpression- The expression representing the array of values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains all comparison.
-
arrayContainsAny
Creates an expression that checks if an array contains any of the provided values.- Parameters:
array- The expression representing the array.values- The values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains any comparison.
-
arrayContainsAny
Creates an expression that checks if an array contains any of the elements of another array.- Parameters:
array- The expression representing the array.arrayExpression- The expression representing the array of values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains any comparison.
-
arrayContainsAny
Creates an expression that checks if an array contains any of the provided values.- Parameters:
arrayFieldName- The field name of the array.values- The values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains any comparison.
-
arrayContainsAny
Creates an expression that checks if an array contains any of the elements of another array.- Parameters:
arrayFieldName- The field name of the array.arrayExpression- The expression representing the array of values to check for.- Returns:
- A new
BooleanExpressionrepresenting the array contains any comparison.
-
arrayLength
Creates an expression that returns the length of an array.- Parameters:
array- The expression representing the array.- Returns:
- A new
Expressionrepresenting the length of the array.
-
arrayLength
Creates an expression that returns the length of an array.- Parameters:
arrayFieldName- The field name of the array.- Returns:
- A new
Expressionrepresenting the length of the array.
-
arrayFirst
Creates an expression that returns the first element of an array.- Parameters:
array- The expression representing the array.- Returns:
- A new
Expressionrepresenting the first element of the array.
-
arrayFirst
Creates an expression that returns the first element of an array.- Parameters:
arrayFieldName- The field name of the array.- Returns:
- A new
Expressionrepresenting the first element of the array.
-
arrayFirstN
Creates an expression that returns the first n elements of an array.- Parameters:
array- The expression representing the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the first n elements of the array.
-
arrayFirstN
Creates an expression that returns the first n elements of an array.- Parameters:
array- The expression representing the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the first n elements of the array.
-
arrayFirstN
Creates an expression that returns the first n elements of an array.- Parameters:
arrayFieldName- The field name of the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the first n elements of the array.
-
arrayFirstN
Creates an expression that returns the first n elements of an array.- Parameters:
arrayFieldName- The field name of the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the first n elements of the array.
-
arrayLast
Creates an expression that returns the last element of an array.- Parameters:
array- The expression representing the array.- Returns:
- A new
Expressionrepresenting the last element of the array.
-
arrayLast
Creates an expression that returns the last element of an array.- Parameters:
arrayFieldName- The field name of the array.- Returns:
- A new
Expressionrepresenting the last element of the array.
-
arrayLastN
Creates an expression that returns the last n elements of an array.- Parameters:
array- The expression representing the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the last n elements of the array.
-
arrayLastN
Creates an expression that returns the last n elements of an array.- Parameters:
array- The expression representing the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the last n elements of the array.
-
arrayLastN
Creates an expression that returns the last n elements of an array.- Parameters:
arrayFieldName- The field name of the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the last n elements of the array.
-
arrayLastN
Creates an expression that returns the last n elements of an array.- Parameters:
arrayFieldName- The field name of the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the last n elements of the array.
-
arrayMinimum
Creates an expression that returns the minimum value of an array.- Parameters:
array- The expression representing the array.- Returns:
- A new
Expressionrepresenting the minimum value of the array.
-
arrayMinimum
Creates an expression that returns the minimum value of an array.- Parameters:
arrayFieldName- The field name of the array.- Returns:
- A new
Expressionrepresenting the minimum value of the array.
-
arrayMinimumN
Creates an expression that returns the n minimum values of an array.Note: Returns the n smallest non-null elements in the array, in ascending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
array- The expression representing the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the n minimum values of the array.
-
arrayMinimumN
Creates an expression that returns the n minimum values of an array.Note: Returns the n smallest non-null elements in the array, in ascending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
array- The expression representing the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the n minimum values of the array.
-
arrayMinimumN
Creates an expression that returns the n minimum values of an array.Note: Returns the n smallest non-null elements in the array, in ascending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
arrayFieldName- The field name of the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the n minimum values of the array.
-
arrayMinimumN
Creates an expression that returns the n minimum values of an array.Note: Returns the n smallest non-null elements in the array, in ascending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
arrayFieldName- The field name of the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the n minimum values of the array.
-
arrayMaximum
Creates an expression that returns the maximum value of an array.- Parameters:
array- The expression representing the array.- Returns:
- A new
Expressionrepresenting the maximum value of the array.
-
arrayMaximum
Creates an expression that returns the maximum value of an array.- Parameters:
arrayFieldName- The field name of the array.- Returns:
- A new
Expressionrepresenting the maximum value of the array.
-
arrayMaximumN
Creates an expression that returns the n maximum values of an array.Note: Returns the n largest non-null elements in the array, in descending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
array- The expression representing the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the n maximum values of the array.
-
arrayMaximumN
Creates an expression that returns the n maximum values of an array.Note: Returns the n largest non-null elements in the array, in descending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
array- The expression representing the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the n maximum values of the array.
-
arrayMaximumN
Creates an expression that returns the n maximum values of an array.Note: Returns the n largest non-null elements in the array, in descending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
arrayFieldName- The field name of the array.n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the n maximum values of the array.
-
arrayMaximumN
Creates an expression that returns the n maximum values of an array.Note: Returns the n largest non-null elements in the array, in descending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
arrayFieldName- The field name of the array.n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the n maximum values of the array.
-
arrayIndexOf
Creates an expression that returns the index of the first occurrence of a value in an array.- Parameters:
array- The expression representing the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the index.
-
arrayIndexOf
Creates an expression that returns the index of the first occurrence of a value in an array.- Parameters:
array- The expression representing the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the index.
-
arrayIndexOf
Creates an expression that returns the index of the first occurrence of a value in an array.- Parameters:
arrayFieldName- The field name of the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the index.
-
arrayIndexOf
Creates an expression that returns the index of the first occurrence of a value in an array.- Parameters:
arrayFieldName- The field name of the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the index.
-
arrayLastIndexOf
Creates an expression that returns the index of the last occurrence of a value in an array.- Parameters:
array- The expression representing the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the last index.
-
arrayLastIndexOf
Creates an expression that returns the index of the last occurrence of a value in an array.- Parameters:
array- The expression representing the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the last index.
-
arrayLastIndexOf
Creates an expression that returns the index of the last occurrence of a value in an array.- Parameters:
arrayFieldName- The field name of the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the last index.
-
arrayLastIndexOf
Creates an expression that returns the index of the last occurrence of a value in an array.- Parameters:
arrayFieldName- The field name of the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the last index.
-
arrayIndexOfAll
Creates an expression that returns all indices of a value in an array.- Parameters:
array- The expression representing the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the indices.
-
arrayIndexOfAll
Creates an expression that returns all indices of a value in an array.- Parameters:
array- The expression representing the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the indices.
-
arrayIndexOfAll
Creates an expression that returns all indices of a value in an array.- Parameters:
arrayFieldName- The field name of the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the indices.
-
arrayIndexOfAll
Creates an expression that returns all indices of a value in an array.- Parameters:
arrayFieldName- The field name of the array.value- The value to search for.- Returns:
- A new
Expressionrepresenting the indices.
-
arrayGet
Creates an expression that returns an element from an array at a specified index.- Parameters:
array- The expression representing the array.offset- The index of the element to return.- Returns:
- A new
Expressionrepresenting the element at the specified index.
-
arrayGet
Creates an expression that returns an element from an array at a specified index.- Parameters:
array- The expression representing the array.offset- The index of the element to return.- Returns:
- A new
Expressionrepresenting the element at the specified index.
-
arrayGet
Creates an expression that returns an element from an array at a specified index.- Parameters:
arrayFieldName- The field name of the array.offset- The index of the element to return.- Returns:
- A new
Expressionrepresenting the element at the specified index.
-
arrayGet
Creates an expression that returns an element from an array at a specified index.- Parameters:
arrayFieldName- The field name of the array.offset- The index of the element to return.- Returns:
- A new
Expressionrepresenting the element at the specified index.
-
arraySum
Creates an expression that returns the sum of the elements of an array.- Parameters:
array- The expression representing the array.- Returns:
- A new
Expressionrepresenting the sum of the elements of the array.
-
arraySum
Creates an expression that returns the sum of the elements of an array.- Parameters:
arrayFieldName- The field name of the array.- Returns:
- A new
Expressionrepresenting the sum of the elements of the array.
-
cosineDistance
Creates an expression that calculates the cosine distance between two vectors.- Parameters:
vector1- The first vector.vector2- The second vector.- Returns:
- A new
Expressionrepresenting the cosine distance.
-
cosineDistance
Creates an expression that calculates the cosine distance between two vectors.- Parameters:
vector1- The first vector.vector2- The second vector.- Returns:
- A new
Expressionrepresenting the cosine distance.
-
cosineDistance
Creates an expression that calculates the cosine distance between two vectors.- Parameters:
vectorFieldName- The field name of the first vector.vector- The second vector.- Returns:
- A new
Expressionrepresenting the cosine distance.
-
cosineDistance
Creates an expression that calculates the cosine distance between two vectors.- Parameters:
vectorFieldName- The field name of the first vector.vector- The second vector.- Returns:
- A new
Expressionrepresenting the cosine distance.
-
dotProduct
Creates an expression that calculates the dot product of two vectors.- Parameters:
vector1- The first vector.vector2- The second vector.- Returns:
- A new
Expressionrepresenting the dot product.
-
dotProduct
Creates an expression that calculates the dot product of two vectors.- Parameters:
vector1- The first vector.vector2- The second vector.- Returns:
- A new
Expressionrepresenting the dot product.
-
dotProduct
Creates an expression that calculates the dot product of two vectors.- Parameters:
vectorFieldName- The field name of the first vector.vector- The second vector.- Returns:
- A new
Expressionrepresenting the dot product.
-
dotProduct
Creates an expression that calculates the dot product of two vectors.- Parameters:
vectorFieldName- The field name of the first vector.vector- The second vector.- Returns:
- A new
Expressionrepresenting the dot product.
-
euclideanDistance
Creates an expression that calculates the Euclidean distance between two vectors.- Parameters:
vector1- The first vector.vector2- The second vector.- Returns:
- A new
Expressionrepresenting the Euclidean distance.
-
euclideanDistance
Creates an expression that calculates the Euclidean distance between two vectors.- Parameters:
vector1- The first vector.vector2- The second vector.- Returns:
- A new
Expressionrepresenting the Euclidean distance.
-
euclideanDistance
Creates an expression that calculates the Euclidean distance between two vectors.- Parameters:
vectorFieldName- The field name of the first vector.vector- The second vector.- Returns:
- A new
Expressionrepresenting the Euclidean distance.
-
euclideanDistance
Creates an expression that calculates the Euclidean distance between two vectors.- Parameters:
vectorFieldName- The field name of the first vector.vector- The second vector.- Returns:
- A new
Expressionrepresenting the Euclidean distance.
-
vectorLength
Creates an expression that calculates the length of a vector.- Parameters:
vectorExpression- The expression representing the vector.- Returns:
- A new
Expressionrepresenting the length of the vector.
-
vectorLength
Creates an expression that calculates the length of a vector.- Parameters:
fieldName- The field name of the vector.- Returns:
- A new
Expressionrepresenting the length of the vector.
-
unixMicrosToTimestamp
Creates an expression that converts a Unix timestamp in microseconds to a Firestore timestamp.- Parameters:
expr- The expression representing the Unix timestamp in microseconds.- Returns:
- A new
Expressionrepresenting the Firestore timestamp.
-
unixMicrosToTimestamp
Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.- Parameters:
fieldName- The name of the field containing the number of microseconds since epoch.- Returns:
- A new
Expressionrepresenting the timestamp.
-
timestampToUnixMicros
Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).- Parameters:
expr- The expression representing the timestamp.- Returns:
- A new
Expressionrepresenting the number of microseconds since epoch.
-
timestampToUnixMicros
Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).- Parameters:
fieldName- The name of the field that contains the timestamp.- Returns:
- A new
Expressionrepresenting the number of microseconds since epoch.
-
unixMillisToTimestamp
Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.- Parameters:
expr- The expression representing the number of milliseconds since epoch.- Returns:
- A new
Expressionrepresenting the timestamp.
-
unixMillisToTimestamp
Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.- Parameters:
fieldName- The name of the field containing the number of milliseconds since epoch.- Returns:
- A new
Expressionrepresenting the timestamp.
-
timestampToUnixMillis
Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).- Parameters:
expr- The expression representing the timestamp.- Returns:
- A new
Expressionrepresenting the number of milliseconds since epoch.
-
timestampToUnixMillis
Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).- Parameters:
fieldName- The name of the field that contains the timestamp.- Returns:
- A new
Expressionrepresenting the number of milliseconds since epoch.
-
unixSecondsToTimestamp
Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.- Parameters:
expr- The expression representing the number of seconds since epoch.- Returns:
- A new
Expressionrepresenting the timestamp.
-
unixSecondsToTimestamp
Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.- Parameters:
fieldName- The name of the field containing the number of seconds since epoch.- Returns:
- A new
Expressionrepresenting the timestamp.
-
timestampToUnixSeconds
Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).- Parameters:
expr- The expression representing the timestamp.- Returns:
- A new
Expressionrepresenting the number of seconds since epoch.
-
timestampToUnixSeconds
Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).- Parameters:
fieldName- The name of the field that contains the timestamp.- Returns:
- A new
Expressionrepresenting the number of seconds since epoch.
-
timestampAdd
Creates an expression that adds a specified amount of time to a timestamp.- Parameters:
timestamp- The expression representing the timestamp.unit- The expression representing the unit of time to add. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The expression representing the amount of time to add.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampAdd
Creates an expression that adds a specified amount of time to a timestamp.- Parameters:
timestamp- The expression representing the timestamp.unit- The unit of time to add. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The amount of time to add.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampAdd
Creates an expression that adds a specified amount of time to a timestamp.- Parameters:
fieldName- The name of the field that contains the timestamp.unit- The expression representing the unit of time to add. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The expression representing the amount of time to add.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampAdd
Creates an expression that adds a specified amount of time to a timestamp.- Parameters:
fieldName- The name of the field that contains the timestamp.unit- The unit of time to add. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The amount of time to add.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampSubtract
public static Expression timestampSubtract(Expression timestamp, Expression unit, Expression amount) Creates an expression that subtracts a specified amount of time to a timestamp.- Parameters:
timestamp- The expression representing the timestamp.unit- The expression representing the unit of time to subtract. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The expression representing the amount of time to subtract.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampSubtract
Creates an expression that subtracts a specified amount of time to a timestamp.- Parameters:
timestamp- The expression representing the timestamp.unit- The unit of time to subtract. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The amount of time to subtract.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampSubtract
Creates an expression that subtracts a specified amount of time to a timestamp.- Parameters:
fieldName- The name of the field that contains the timestamp.unit- The unit of time to subtract. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The amount of time to subtract.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampSubtract
Creates an expression that subtracts a specified amount of time to a timestamp.- Parameters:
fieldName- The name of the field that contains the timestamp.unit- The unit of time to subtract. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The amount of time to subtract.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampTruncate
Creates an expression that truncates a timestamp to a specified granularity.- Parameters:
timestamp- The timestamp expression.granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncate
Creates an expression that truncates a timestamp to a specified granularity.- Parameters:
timestamp- The timestamp expression.granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncate
Creates an expression that truncates a timestamp to a specified granularity.- Parameters:
fieldName- The name of the field containing the timestamp.granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncate
Creates an expression that truncates a timestamp to a specified granularity.- Parameters:
fieldName- The name of the field containing the timestamp.granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(Expression timestamp, String granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
timestamp- The timestamp expression.granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(Expression timestamp, Expression granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
timestamp- The timestamp expression.granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(String fieldName, String granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(String fieldName, Expression granularity, String timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(Expression timestamp, Expression granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
timestamp- The timestamp expression.granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(Expression timestamp, String granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
timestamp- The timestamp expression.granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(String fieldName, String granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
public static Expression timestampTruncateWithTimezone(String fieldName, Expression granularity, Expression timezone) Creates an expression that truncates a timestamp to a specified granularity in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampDiff
Creates an expression that calculates the difference between two timestamps.- Parameters:
end- The ending timestamp expression.start- The starting timestamp expression.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampDiff
Creates an expression that calculates the difference between two timestamps.- Parameters:
end- The ending timestamp expression.start- The starting timestamp expression.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampDiff
Creates an expression that calculates the difference between two timestamps.- Parameters:
endFieldName- The ending timestamp field name.startFieldName- The starting timestamp field name.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampDiff
Creates an expression that calculates the difference between two timestamps.- Parameters:
endFieldName- The ending timestamp field name.start- The starting timestamp expression.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampDiff
Creates an expression that calculates the difference between two timestamps.- Parameters:
end- The ending timestamp expression.startFieldName- The starting timestamp field name.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampExtract
Creates an expression that extracts a specified part from a timestamp.- Parameters:
timestamp- The timestamp expression.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtract
Creates an expression that extracts a specified part from a timestamp.- Parameters:
timestamp- The timestamp expression.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtract
Creates an expression that extracts a specified part from a timestamp.- Parameters:
fieldName- The name of the field containing the timestamp.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtract
Creates an expression that extracts a specified part from a timestamp.- Parameters:
fieldName- The name of the field containing the timestamp.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(Expression timestamp, Expression part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
timestamp- The timestamp expression.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(Expression timestamp, Expression part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
timestamp- The timestamp expression.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(Expression timestamp, String part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
timestamp- The timestamp expression.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(String fieldName, Expression part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(String fieldName, String part, String timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(Expression timestamp, String part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
timestamp- The timestamp expression.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(String fieldName, Expression part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
public static Expression timestampExtractWithTimezone(String fieldName, String part, Expression timezone) Creates an expression that extracts a specified part from a timestamp in a given timezone.- Parameters:
fieldName- The name of the field containing the timestamp.part- The part to extract from the timestamp. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for extraction.Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
conditional
public static Expression conditional(BooleanExpression condition, Expression thenExpr, Expression elseExpr) Creates a conditional expression that evaluates to athenExprexpression if a condition is true or anelseExprexpression if the condition is false.- Parameters:
condition- The condition to evaluate.thenExpr- The expression to evaluate if the condition is true.elseExpr- The expression to evaluate if the condition is false.- Returns:
- A new
Expressionrepresenting the conditional operation.
-
conditional
public static Expression conditional(BooleanExpression condition, Object thenValue, Object elseValue) Creates a conditional expression that evaluates to athenValueif a condition is true or anelseValueif the condition is false.- Parameters:
condition- The condition to evaluate.thenValue- Value if the condition is true.elseValue- Value if the condition is false.- Returns:
- A new
Expressionrepresenting the conditional operation.
-
ifError
Creates an expression that returns thecatchExprargument if there is an error, else return the result of thetryExprargument evaluation.- Parameters:
tryExpr- The try expression.catchExpr- The catch expression that will be evaluated and returned if thetryExprproduces an error.- Returns:
- A new
Expressionrepresenting the ifError operation.
-
ifError
Creates an expression that returns thecatchExprargument if there is an error, else return the result of thetryExprargument evaluation.This overload will return
BooleanExpressionwhen both parameters are alsoBooleanExpression.- Parameters:
tryExpr- The try boolean expression.catchExpr- The catch boolean expression that will be evaluated and returned if thetryExprproduces an error.- Returns:
- A new
BooleanExpressionrepresenting the ifError operation.
-
ifError
Creates an expression that returns thecatchValueargument if there is an error, else return the result of thetryExprargument evaluation.- Parameters:
tryExpr- The try expression.catchValue- The value that will be returned if thetryExprproduces an error.- Returns:
- A new
Expressionrepresenting the ifError operation.
-
isError
Creates an expression that checks if a given expression produces an error.- Parameters:
expr- The expression to check.- Returns:
- A new
BooleanExpressionrepresenting the `isError` check.
-
geoDistance
Evaluates to the distance in meters between the location in the specified field and the query location.This Expression can only be used within a
Searchstage.- Parameters:
fieldName- Specifies the field in the document which contains the firstGeoPointfor distance computation.location- Compute distance to thisGeoPoint.- Returns:
- A new
Expressionrepresenting the geoDistance operation.
-
geoDistance
Evaluates to the distance in meters between the location in the specified field and the query location.This Expression can only be used within a
Searchstage.Example:
db.pipeline().collection("restaurants").search( Search.withQuery("waffles").withSort(geoDistance(field("location"), new GeoPoint(37.0, -122.0)).ascending()) )- Parameters:
field- Specifies the field in the document which contains the firstGeoPointfor distance computation.location- Compute distance to thisGeoPoint.- Returns:
- A new
Expressionrepresenting the geoDistance operation.
-
documentMatches
Perform a full-text search on all indexed search fields in the document.This Expression can only be used within a
Searchstage.Example:
db.pipeline().collection("restaurants").search(Search.withQuery(documentMatches("waffles OR pancakes")))- Parameters:
rquery- Define the search query using the search domain-specific language (DSL).- Returns:
- A new
BooleanExpressionrepresenting the documentMatches operation.
-
score
Evaluates to the search score that reflects the topicality of the document to all of the text predicates (for example:documentMatches) in the search query.This Expression can only be used within a
Searchstage.Example:
db.pipeline().collection("restaurants").search( Search.withQuery("waffles").withSort(score().descending()) )- Returns:
- A new
Expressionrepresenting the score operation.
-
between
-
between
-
documentId
Creates an expression that returns the document ID from a path.- Parameters:
documentPath- An expression the evaluates to document path.- Returns:
- A new
Expressionrepresenting the documentId operation.
-
documentId
Creates an expression that returns the document ID from a path.- Parameters:
documentPath- The string representation of the document path.- Returns:
- A new
Expressionrepresenting the documentId operation.
-
documentId
Creates an expression that returns the document ID from aDocumentReference.- Parameters:
docRef- TheDocumentReference.- Returns:
- A new
Expressionrepresenting the documentId operation.
-
collectionId
Creates an expression that returns the collection ID from a path.- Parameters:
path- An expression the evaluates to document path.- Returns:
- A new
Expressionrepresenting the collectionId operation.
-
collectionId
Creates an expression that returns the collection ID from a path.- Parameters:
pathFieldName- The field name of the path.- Returns:
- A new
Expressionrepresenting the collectionId operation.
-
parent
Creates an expression that returns the parent document of a document reference.- Parameters:
documentPath- An expression that evaluates to a document path.- Returns:
- A new
Expressionrepresenting the parent operation.
-
parent
Creates an expression that returns the parent document of a document reference.- Parameters:
documentPath- The string representation of the document path.- Returns:
- A new
Expressionrepresenting the parent operation.
-
parent
Creates an expression that returns the parent document of a document reference.- Parameters:
docRef- TheDocumentReference.- Returns:
- A new
Expressionrepresenting the parent operation.
-
exists
Creates an expression that checks if a field exists.- Parameters:
value- An expression evaluates to the name of the field to check.- Returns:
- A new
Expressionrepresenting the exists check.
-
exists
Creates an expression that checks if a field exists.- Parameters:
fieldName- The field name to check.- Returns:
- A new
Expressionrepresenting the exists check.
-
isAbsent
Creates an expression that returns true if a value is absent. Otherwise, returns false even if the value is null.- Parameters:
value- The expression to check.- Returns:
- A new
BooleanExpressionrepresenting the isAbsent operation.
-
isAbsent
Creates an expression that returns true if a field is absent. Otherwise, returns false even if the field value is null.- Parameters:
fieldName- The field to check.- Returns:
- A new
BooleanExpressionrepresenting the isAbsent operation.
-
type
Creates an expression that returns a string indicating the type of the value this expression evaluates to.- Parameters:
expr- The expression to get the type of.- Returns:
- A new
Expressionrepresenting the type operation.
-
type
Creates an expression that returns a string indicating the type of the value this field evaluates to.- Parameters:
fieldName- The name of the field to get the type of.- Returns:
- A new
Expressionrepresenting the type operation.
-
isType
Creates an expression that checks if the result of an expression is of the given type.Supported values for
typeare: "null", "array", "boolean", "bytes", "timestamp", "geo_point", "number", "int32", "int64", "float64", "decimal128", "map", "reference", "string", "vector", "max_key", "min_key", "object_id", "regex", and "request_timestamp".- Parameters:
expr- The expression to check the type of.type- The type to check for.- Returns:
- A new
BooleanExpressionthat evaluates to true if the expression's result is of the given type, false otherwise.
-
isType
Creates an expression that checks if the value of a field is of the given type.Supported values for
typeare: "null", "array", "boolean", "bytes", "timestamp", "geo_point", "number", "int32", "int64", "float64", "decimal128", "map", "reference", "string", "vector", "max_key", "min_key", "object_id", "regex", and "request_timestamp".- Parameters:
fieldName- The name of the field to check the type of.type- The type to check for.- Returns:
- A new
BooleanExpressionthat evaluates to true if the expression's result is of the given type, false otherwise.
-
round
Creates an expression that roundsnumericExprto nearest integer.Rounds away from zero in halfway cases.
- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting an integer result from the round operation.
-
round
Creates an expression that roundsnumericFieldto nearest integer.Rounds away from zero in halfway cases.
- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting an integer result from the round operation.
-
roundToPrecision
Creates an expression that rounds offnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative. Rounds away from zero in halfway cases.- Parameters:
numericExpr- An expression that returns number when evaluated.decimalPlace- The number of decimal places to round.- Returns:
- A new
Expressionrepresenting the round operation.
-
roundToPrecision
Creates an expression that rounds offnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative. Rounds away from zero in halfway cases.- Parameters:
numericField- Name of field that returns number when evaluated.decimalPlace- The number of decimal places to round.- Returns:
- A new
Expressionrepresenting the round operation.
-
roundToPrecision
Creates an expression that rounds offnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative. Rounds away from zero in halfway cases.- Parameters:
numericExpr- An expression that returns number when evaluated.decimalPlace- The number of decimal places to round.- Returns:
- A new
Expressionrepresenting the round operation.
-
roundToPrecision
Creates an expression that rounds offnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative. Rounds away from zero in halfway cases.- Parameters:
numericField- Name of field that returns number when evaluated.decimalPlace- The number of decimal places to round.- Returns:
- A new
Expressionrepresenting the round operation.
-
rand
Creates an expression that returns a random double between 0.0 and 1.0 but not including 1.0.- Returns:
- A new
Expressionrepresenting a random double result from the rand operation.
-
trunc
Creates an expression that truncatesnumericExprto an integer.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
trunc
Creates an expression that truncatesnumericFieldto an integer.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
truncToPrecision
Creates an expression that truncatesnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.- Parameters:
numericExpr- An expression that returns number when evaluated.decimalPlace- The number of decimal places to truncate.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
truncToPrecision
Creates an expression that truncatesnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.- Parameters:
numericField- Name of field that returns number when evaluated.decimalPlace- The number of decimal places to truncate.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
truncToPrecision
Creates an expression that truncatesnumericExprtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.- Parameters:
numericExpr- An expression that returns number when evaluated.decimalPlace- The number of decimal places to truncate.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
truncToPrecision
Creates an expression that truncatesnumericFieldtodecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.- Parameters:
numericField- Name of field that returns number when evaluated.decimalPlace- The number of decimal places to truncate.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
ceil
Creates an expression that returns the smallest integer that isn't less thannumericExpr.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting an integer result from the ceil operation.
-
ceil
Creates an expression that returns the smallest integer that isn't less thannumericField.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting an integer result from the ceil operation.
-
floor
Creates an expression that returns the largest integer that isn't less thannumericExpr.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting an integer result from the floor operation.
-
floor
Creates an expression that returns the largest integer that isn't less thannumericField.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting an integer result from the floor operation.
-
pow
Creates an expression that returns thenumericExprraised to the power of theexponent. Returns infinity on overflow and zero on underflow.- Parameters:
numericExpr- An expression that returns number when evaluated.exponent- The numeric power to raise thenumericExpr.- Returns:
- A new
Expressionrepresenting a numeric result from raisingnumericExprto the power ofexponent.
-
pow
Creates an expression that returns thenumericFieldraised to the power of theexponent. Returns infinity on overflow and zero on underflow.- Parameters:
numericField- Name of field that returns number when evaluated.exponent- The numeric power to raise thenumericField.- Returns:
- A new
Expressionrepresenting a numeric result from raisingnumericFieldto the power ofexponent.
-
pow
Creates an expression that returns thenumericExprraised to the power of theexponent. Returns infinity on overflow and zero on underflow.- Parameters:
numericExpr- An expression that returns number when evaluated.exponent- The numeric power to raise thenumericExpr.- Returns:
- A new
Expressionrepresenting a numeric result from raisingnumericExprto the power ofexponent.
-
pow
Creates an expression that returns thenumericFieldraised to the power of theexponent. Returns infinity on overflow and zero on underflow.- Parameters:
numericField- Name of field that returns number when evaluated.exponent- The numeric power to raise thenumericField.- Returns:
- A new
Expressionrepresenting a numeric result from raisingnumericFieldto the power ofexponent.
-
abs
Creates an expression that returns the absolute value ofnumericExpr.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the absolute value operation.
-
abs
Creates an expression that returns the absolute value ofnumericField.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the absolute value operation.
-
exp
Creates an expression that returns Euler's number e raised to the power ofnumericExpr.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the exponentiation.
-
exp
Creates an expression that returns Euler's number e raised to the power ofnumericField.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the exponentiation.
-
ln
Creates an expression that returns the natural logarithm (base e) ofnumericExpr.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the natural logarithm.
-
ln
Creates an expression that returns the natural logarithm (base e) ofnumericField.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the natural logarithm.
-
log
Creates an expression that returns the logarithm ofnumericExprwith a givenbase.- Parameters:
numericExpr- An expression that returns number when evaluated.base- The base of the logarithm.- Returns:
- A new
Expressionrepresenting a numeric result from the logarithm ofnumericExprwith a givenbase.
-
log
Creates an expression that returns the logarithm ofnumericFieldwith a givenbase.- Parameters:
numericField- Name of field that returns number when evaluated.base- The base of the logarithm.- Returns:
- A new
Expressionrepresenting a numeric result from the logarithm ofnumericFieldwith a givenbase.
-
log
Creates an expression that returns the logarithm ofnumericExprwith a givenbase.- Parameters:
numericExpr- An expression that returns number when evaluated.base- The base of the logarithm.- Returns:
- A new
Expressionrepresenting a numeric result from the logarithm ofnumericExprwith a givenbase.
-
log
Creates an expression that returns the logarithm ofnumericFieldwith a givenbase.- Parameters:
numericField- Name of field that returns number when evaluated.base- The base of the logarithm.- Returns:
- A new
Expressionrepresenting a numeric result from the logarithm ofnumericFieldwith a givenbase.
-
log10
Creates an expression that returns the base 10 logarithm ofnumericExpr.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the base 10 logarithm.
-
log10
Creates an expression that returns the base 10 logarithm ofnumericField.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the base 10 logarithm.
-
sqrt
Creates an expression that returns the square root ofnumericExpr.- Parameters:
numericExpr- An expression that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the square root operation.
-
sqrt
Creates an expression that returns the square root ofnumericField.- Parameters:
numericField- Name of field that returns number when evaluated.- Returns:
- A new
Expressionrepresenting the numeric result of the square root operation.
-
isNotNaN
Creates an expression that checks if the results ofexpris NOT 'NaN' (Not a Number).- Parameters:
expr- The expression to check.- Returns:
- A new
BooleanExpressionrepresenting the isNotNan operation.
-
isNotNaN
Creates an expression that checks if the results of this expression is NOT 'NaN' (Not a Number).- Parameters:
fieldName- The field to check.- Returns:
- A new
BooleanExpressionrepresenting the isNotNan operation.
-
logicalMaximum
Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.- Parameters:
expr- The first operand expression.others- Optional additional expressions or literals.- Returns:
- A new
Expressionrepresenting the logical maximum operation.
-
logicalMaximum
Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.- Parameters:
fieldName- The first operand field name.others- Optional additional expressions or literals.- Returns:
- A new
Expressionrepresenting the logical maximum operation.
-
logicalMinimum
Creates an expression that returns the smallest value between multiple input expressions or literal values. Based on Firestore's value type ordering.- Parameters:
expr- The first operand expression.others- Optional additional expressions or literals.- Returns:
- A new
Expressionrepresenting the logical minimum operation.
-
logicalMinimum
Creates an expression that returns the smallest value between multiple input expressions or literal values. Based on Firestore's value type ordering.- Parameters:
fieldName- The first operand field name.others- Optional additional expressions or literals.- Returns:
- A new
Expressionrepresenting the logical minimum operation.
-
concat
Creates an expression that concatenates this expression with other values.- Parameters:
others- Optional additional expressions or constants to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated value.
-
ifAbsent
Creates an expression that returns a default value if this expression evaluates to an absent value.- Parameters:
elseValue- The default value.- Returns:
- A new
Expressionrepresenting the ifAbsent operation.
-
ifNull
Creates an expression that returns a default value if this expression evaluates null.Note: This function provides a fallback for both absent and explicit null values. In contrast,
ifAbsent(com.google.cloud.firestore.pipeline.expressions.Expression,com.google.cloud.firestore.pipeline.expressions.Expression)only triggers for missing fields.- Parameters:
elseValue- The default value that will be returned.- Returns:
- A new
Expressionrepresenting the ifNull operation.
-
coalesce
Returns the first non-null, non-absent argument, without evaluating the rest of the arguments. When all arguments are null or absent, returns the last argument.- Parameters:
second- The next expression or literal to evaluate.others- Additional expressions or literals to evaluate.- Returns:
- A new
Expressionrepresenting the coalesce operation.
-
join
Creates an expression that joins the elements of this array expression into a string.- Parameters:
delimiter- The delimiter to use.- Returns:
- A new
Expressionrepresenting the join operation.
-
join
Creates an expression that joins the elements of this array expression into a string.- Parameters:
delimiter- The delimiter to use.- Returns:
- A new
Expressionrepresenting the join operation.
-
isNotNaN
Creates an expression that checks if the results of this expression is NOT 'NaN' (Not a Number).- Returns:
- A new
BooleanExpressionrepresenting the isNotNan operation.
-
logicalMaximum
Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.- Parameters:
others- Optional additional expressions or literals.- Returns:
- A new
Expressionrepresenting the logical maximum operation.
-
logicalMinimum
Creates an expression that returns the smallest value between multiple input expressions or literal values. Based on Firestore's value type ordering.- Parameters:
others- Optional additional expressions or literals.- Returns:
- A new
Expressionrepresenting the logical minimum operation.
-
round
Creates an expression that rounds this numeric expression to nearest integer.Rounds away from zero in halfway cases.
- Returns:
- A new
Expressionrepresenting an integer result from the round operation.
-
roundToPrecision
Creates an expression that rounds off this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative. Rounds away from zero in halfway cases.- Parameters:
decimalPlace- The number of decimal places to round.- Returns:
- A new
Expressionrepresenting the round operation.
-
roundToPrecision
Creates an expression that rounds off this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, rounds off digits to the left of the decimal point ifdecimalPlaceis negative. Rounds away from zero in halfway cases.- Parameters:
decimalPlace- The number of decimal places to round.- Returns:
- A new
Expressionrepresenting the round operation.
-
trunc
Creates an expression that truncates this numeric expression to an integer.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
truncToPrecision
Creates an expression that truncates this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.- Parameters:
decimalPlace- The number of decimal places to truncate.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
truncToPrecision
Creates an expression that truncates this numeric expression todecimalPlacedecimal places ifdecimalPlaceis positive, truncates digits to the left of the decimal point ifdecimalPlaceis negative.- Parameters:
decimalPlace- The number of decimal places to truncate.- Returns:
- A new
Expressionrepresenting the trunc operation.
-
ceil
Creates an expression that returns the smallest integer that isn't less than this numeric expression.- Returns:
- A new
Expressionrepresenting an integer result from the ceil operation.
-
floor
Creates an expression that returns the largest integer that isn't less than this numeric expression.- Returns:
- A new
Expressionrepresenting an integer result from the floor operation.
-
pow
Creates an expression that returns this numeric expression raised to the power of theexponent. Returns infinity on overflow and zero on underflow.- Parameters:
exponent- The numeric power to raise this numeric expression.- Returns:
- A new
Expressionrepresenting a numeric result from raising this numeric expression to the power ofexponent.
-
pow
Creates an expression that returns this numeric expression raised to the power of theexponent. Returns infinity on overflow and zero on underflow.- Parameters:
exponent- The numeric power to raise this numeric expression.- Returns:
- A new
Expressionrepresenting a numeric result from raising this numeric expression to the power ofexponent.
-
abs
Creates an expression that returns the absolute value of this numeric expression.- Returns:
- A new
Expressionrepresenting the numeric result of the absolute value operation.
-
exp
Creates an expression that returns Euler's number e raised to the power of this numeric expression.- Returns:
- A new
Expressionrepresenting the numeric result of the exponentiation.
-
ln
Creates an expression that returns the natural logarithm (base e) of this numeric expression.- Returns:
- A new
Expressionrepresenting the numeric result of the natural logarithm.
-
log10
Creates an expression that returns the base 10 logarithm of this numeric expression.- Returns:
- A new
Expressionrepresenting the numeric result of the base 10 logarithm.
-
arraySum
Creates an expression that returns the sum of the elements of this array expression.- Returns:
- A new
Expressionrepresenting the sum of the elements of the array.
-
sqrt
Creates an expression that returns the square root of this numeric expression.- Returns:
- A new
Expressionrepresenting the numeric result of the square root operation.
-
add
Creates an expression that adds this numeric expression to another numeric expression.- Parameters:
other- Numeric expression to add.- Returns:
- A new
Expressionrepresenting the addition operation.
-
subtract
Creates an expression that subtracts a numeric expressions from this numeric expression.- Parameters:
other- Constant to subtract.- Returns:
- A new
Expressionrepresenting the subtract operation.
-
multiply
Creates an expression that multiplies this numeric expression with another numeric expression.- Parameters:
other- Numeric expression to multiply.- Returns:
- A new
Expressionrepresenting the multiplication operation.
-
divide
Creates an expression that divides this numeric expression by another numeric expression.- Parameters:
other- Numeric expression to divide this numeric expression by.- Returns:
- A new
Expressionrepresenting the division operation.
-
mod
Creates an expression that calculates the modulo (remainder) of dividing this numeric expressions by another numeric expression.- Parameters:
other- The numeric expression to divide this expression by.- Returns:
- A new
Expressionrepresenting the modulo operation.
-
equal
Creates an expression that checks if this expression is equal to avalue.- Parameters:
other- The value to compare to.- Returns:
- A new
BooleanExpressionrepresenting the equality comparison.
-
notEqual
Creates an expression that checks if this expression is not equal to avalue.- Parameters:
other- The value to compare to.- Returns:
- A new
BooleanExpressionrepresenting the inequality comparison.
-
greaterThan
Creates an expression that checks if this expression is greater than avalue.- Parameters:
other- The value to compare to.- Returns:
- A new
BooleanExpressionrepresenting the greater than comparison.
-
greaterThanOrEqual
Creates an expression that checks if this expression is greater than or equal to avalue.- Parameters:
other- The value to compare to.- Returns:
- A new
BooleanExpressionrepresenting the greater than or equal to comparison.
-
lessThan
Creates an expression that checks if this expression is less than a value.- Parameters:
other- The value to compare to.- Returns:
- A new
BooleanExpressionrepresenting the less than comparison.
-
lessThanOrEqual
Creates an expression that checks if this expression is less than or equal to avalue.- Parameters:
other- The value to compare to.- Returns:
- A new
BooleanExpressionrepresenting the less than or equal to comparison.
-
equalAny
Creates an expression that checks if this expression, when evaluated, is equal to any of the providedvalues.- Parameters:
other- The values to check against.- Returns:
- A new
BooleanExpressionrepresenting the 'IN' comparison.
-
notEqualAny
Creates an expression that checks if this expression, when evaluated, is not equal to all the providedvalues.- Parameters:
other- The values to check against.- Returns:
- A new
BooleanExpressionrepresenting the 'NOT IN' comparison.
-
charLength
Creates an expression that calculates the character length of this string expression in UTF8.- Returns:
- A new
Expressionrepresenting the charLength operation.
-
byteLength
Creates an expression that calculates the length of a string in UTF-8 bytes, or just the length of a Blob.- Returns:
- A new
Expressionrepresenting the length of the string in bytes.
-
length
Creates an expression that calculates the length of the expression if it is a string, array, map, or Blob.- Returns:
- A new
Expressionrepresenting the length of the expression.
-
like
Creates an expression that performs a case-sensitive wildcard string comparison.- Parameters:
pattern- The pattern to search for. You can use "%" as a wildcard character.- Returns:
- A new
BooleanExpressionrepresenting the like operation.
-
regexContains
Creates an expression that checks if this string expression contains a specified regular expression as a substring.- Parameters:
pattern- The regular expression to use for the search.- Returns:
- A new
BooleanExpressionrepresenting the contains regular expression comparison.
-
regexFind
Creates an expression that returns the first substring of a string expression that matches a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
pattern- The regular expression to search for.- Returns:
- A new
Expressionrepresenting the regular expression find function.
-
regexFindAll
Creates an expression that evaluates to a list of all substrings in a string expression that match a specified regular expression.This expression uses the [RE2](https://github.com/google/re2/wiki/Syntax) regular expression syntax.
- Parameters:
pattern- The regular expression to search for.- Returns:
- A new
Expressionthat evaluates to a list of matched substrings.
-
regexMatch
Creates an expression that checks if this string expression matches a specified regular expression.- Parameters:
pattern- The regular expression to use for the match.- Returns:
- A new
BooleanExpressionrepresenting the regular expression match comparison.
-
stringContains
Creates an expression that checks if this string expression contains a specified substring.- Parameters:
substring- The expression representing the substring to search for.- Returns:
- A new
BooleanExpressionrepresenting the contains comparison.
-
startsWith
Creates an expression that checks if this string expression starts with a givenprefix.- Parameters:
prefix- The prefix string expression to check for.- Returns:
- A new
Expressionrepresenting the the 'starts with' comparison.
-
endsWith
Creates an expression that checks if this string expression ends with a givensuffix.- Parameters:
suffix- The suffix string expression to check for.- Returns:
- A new
Expressionrepresenting the 'ends with' comparison.
-
substring
Creates an expression that returns a substring of the given string.- Parameters:
index- The starting index of the substring.length- The length of the substring.- Returns:
- A new
Expressionrepresenting the substring.
-
toLower
Creates an expression that converts this string expression to lowercase.- Returns:
- A new
Expressionrepresenting the lowercase string.
-
toUpper
Creates an expression that converts this string expression to uppercase.- Returns:
- A new
Expressionrepresenting the lowercase string.
-
trim
Creates an expression that removes leading and trailing whitespace from this string expression.- Returns:
- A new
Expressionrepresenting the trimmed string.
-
trimValue
Creates an expression that removes specified characters from the beginning and end of this string or blob expression.- Parameters:
characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
trimValue
Creates an expression that removes specified characters from the beginning and end of this string or blob expression.- Parameters:
characters- The expression representing the characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrim
Creates an expression that removes whitespace from the beginning of this string or blob expression.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrimValue
Creates an expression that removes the specified set of characters from the beginning of this string or blob expression.- Parameters:
characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
ltrimValue
Creates an expression that removes the specified characters or bytes from the beginning of this string or blob expression.- Parameters:
characters- The expression representing the characters or bytes to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrim
Creates an expression that removes whitespace from the end of this string or blob expression.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrimValue
Creates an expression that removes the specified set of characters from the end of this string or blob expression.- Parameters:
characters- The characters to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
rtrimValue
Creates an expression that removes the specified characters or bytes from the end of this string or blob expression.- Parameters:
characters- The expression representing the characters or bytes to remove.- Returns:
- A new
Expressionrepresenting the trimmed string or blob.
-
stringRepeat
Creates an expression that repeats a string or blob a specified number of times.- Parameters:
repetitions- The number of times to repeat the string or blob.- Returns:
- A new
Expressionrepresenting the repeated string or blob.
-
stringRepeat
Creates an expression that repeats a string or blob a specified number of times.- Parameters:
repetitions- The expression representing the number of times to repeat.- Returns:
- A new
Expressionrepresenting the repeated string or blob.
-
stringReplaceAll
Creates an expression that replaces all occurrences of a substring or byte sequence.- Parameters:
find- The match pattern.replacement- The replacement string/bytes.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceAll
Creates an expression that replaces all occurrences of a substring or byte sequence.- Parameters:
find- The expression representing the match pattern.replacement- The expression representing the replacement value.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceOne
Creates an expression that replaces the first occurrence of a substring or byte sequence.- Parameters:
find- The match pattern.replacement- The replacement string/bytes.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringReplaceOne
Creates an expression that replaces the first occurrence of a substring or byte sequence.- Parameters:
find- The expression representing the match pattern.replacement- The expression representing the replacement value.- Returns:
- A new
Expressionrepresenting the replaced value.
-
stringIndexOf
Creates an expression that returns the index of the first occurrence of a substring or bytes.- Parameters:
search- The search pattern.- Returns:
- A new
Expressionrepresenting the index.
-
stringIndexOf
Creates an expression that returns the index of the first occurrence of a substring or bytes.- Parameters:
search- The expression representing the search pattern.- Returns:
- A new
Expressionrepresenting the index.
-
split
Creates an expression that splits this string or blob expression by a delimiter.- Parameters:
delimiter- The delimiter to split by.- Returns:
- A new
Expressionrepresenting the split string or blob as an array.
-
split
Creates an expression that splits this string or blob expression by a delimiter.- Parameters:
delimiter- The delimiter to split by.- Returns:
- A new
Expressionrepresenting the split string or blob as an array.
-
stringConcat
Creates an expression that concatenates string expressions and string constants together.- Parameters:
others- The string expressions or string constants to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated string.
-
stringConcat
Creates an expression that concatenates string expressions together.- Parameters:
others- The string expressions or string constants to concatenate.- Returns:
- A new
Expressionrepresenting the concatenated string.
-
mapGet
Accesses a map (object) value using the providedkey.- Parameters:
key- The key to access in the map.- Returns:
- A new
Expressionrepresenting the value associated with the given key in the map.
-
isAbsent
Creates an expression that returns true if yhe result of this expression is absent. Otherwise, returns false even if the value is null.- Returns:
- A new
BooleanExpressionrepresenting the isAbsent operation.
-
isNaN
Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number).- Returns:
- A new
BooleanExpressionrepresenting the isNan operation.
-
isNull
Creates an expression that checks if tbe result of this expression is null.- Returns:
- A new
BooleanExpressionrepresenting the isNull operation.
-
isNotNull
Creates an expression that checks if tbe result of this expression is not null.- Returns:
- A new
BooleanExpressionrepresenting the isNotNull operation.
-
sum
Creates an aggregation that calculates the sum of this numeric expression across multiple stage inputs.- Returns:
- A new
AggregateFunctionrepresenting the sum aggregation.
-
average
Creates an aggregation that calculates the average (mean) of this numeric expression across multiple stage inputs.- Returns:
- A new
AggregateFunctionrepresenting the average aggregation.
-
minimum
Creates an aggregation that finds the minimum value of this expression across multiple stage inputs.- Returns:
- A new
AggregateFunctionrepresenting the minimum aggregation.
-
maximum
Creates an aggregation that finds the maximum value of this expression across multiple stage inputs.- Returns:
- A new
AggregateFunctionrepresenting the maximum aggregation.
-
count
Creates an aggregation that counts the number of stage inputs with valid evaluations of the this expression.- Returns:
- A new
AggregateFunctionrepresenting the count aggregation.
-
countDistinct
Creates an aggregation that counts the number of distinct values of this expression.- Returns:
- A new
AggregateFunctionrepresenting the count distinct aggregation.
-
first
Creates an aggregation that finds the first value of this expression across multiple stage inputs.- Returns:
- A new
AggregateFunctionrepresenting the first aggregation.
-
last
Creates an aggregation that finds the last value of this expression across multiple stage inputs.- Returns:
- A new
AggregateFunctionrepresenting the last aggregation.
-
arrayAgg
Creates an aggregation that collects all values of this expression across multiple stage inputs into an array.If the expression resolves to an absent value, it is converted to `null`. The order of elements in the output array is not stable and shouldn't be relied upon.
- Returns:
- A new
AggregateFunctionrepresenting the array_agg aggregation.
-
arrayAggDistinct
Creates an aggregation that collects all distinct values of this expression across multiple stage inputs into an array.If the expression resolves to an absent value, it is converted to `null`. The order of elements in the output array is not stable and shouldn't be relied upon.
- Returns:
- A new
AggregateFunctionrepresenting the array_agg_distinct aggregation.
-
ascending
Create anOrderingthat sorts documents in ascending order based on value of this expression- Returns:
- A new
Orderingobject with ascending sort by this expression.
-
descending
Create anOrderingthat sorts documents in descending order based on value of this expression- Returns:
- A new
Orderingobject with descending sort by this expression.
-
as
Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values.
- Parameters:
alias- The alias to assign to this expression.- Returns:
- A new
AliasedExpressionthat wraps this expression and associates it with the provided alias.
-
mapMerge
Creates an expression that merges multiple maps into a single map. If multiple maps have the same key, the later value is used.- Parameters:
secondMap- Map expression that will be merged.otherMaps- Additional maps to merge.- Returns:
- A new
Expressionrepresenting the mapMerge operation.
-
mapRemove
Creates an expression that removes a key from this map expression.- Parameters:
key- The name of the key to remove from this map expression.- Returns:
- A new
Expressionthat evaluates to a modified map.
-
mapRemove
Creates an expression that removes a key from this map expression.- Parameters:
key- The name of the key to remove from this map expression.- Returns:
- A new
Expressionthat evaluates to a modified map.
-
mapSet
Creates an expression that returns a new map with the specified entries added or updated.Note that
mapSetonly performs shallow updates to the map. Setting a value tonullwill retain the key with anullvalue. To remove a key entirely, usemapRemove.- Parameters:
key- The key to set.value- The value to set.moreKeyValues- Additional key-value pairs to set.- Returns:
- A new
Expressionrepresenting the map with the entries set.
-
mapSet
Creates an expression that returns a new map with the specified entries added or updated.- Parameters:
key- The key to set.value- The value to set.moreKeyValues- Additional key-value pairs to set.- Returns:
- A new
Expressionrepresenting the map with the entries set.
-
mapKeys
Creates an expression that returns the keys of this map expression.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Returns:
- A new
Expressionrepresenting the keys of the map.
-
mapValues
Creates an expression that returns the values of this map expression.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Returns:
- A new
Expressionrepresenting the values of the map.
-
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.While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
- Returns:
- A new
Expressionrepresenting the entries of the map.
-
reverse
Creates an expression that reverses this expression, which must be a string, blob, or array.- Returns:
- A new
Expressionrepresenting the reversed value.
-
arrayConcat
Creates an expression that concatenates a field's array value with other arrays.- Parameters:
otherArrays- Optional additional array expressions or array literals to concatenate.- Returns:
- A new
Expressionrepresenting the arrayConcat operation.
-
arrayFirst
Returns the first element of an array.- Returns:
- A new
Expressionrepresenting the first element of the array.
-
arrayFirstN
Returns the first n elements of an array.- Parameters:
n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the first n elements of the array.
-
arrayFirstN
Returns the first n elements of an array.- Parameters:
n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the first n elements of the array.
-
arrayLast
Returns the last element of an array.- Returns:
- A new
Expressionrepresenting the last element of the array.
-
arrayLastN
Returns the last n elements of an array.- Parameters:
n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the last n elements of the array.
-
arrayLastN
Returns the last n elements of an array.- Parameters:
n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the last n elements of the array.
-
arrayMinimum
Returns the minimum value of an array.- Returns:
- A new
Expressionrepresenting the minimum value of the array.
-
arrayMinimumN
Returns the n minimum values of an array.Note: Returns the n smallest non-null elements in the array, in ascending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the n minimum values of the array.
-
arrayMinimumN
Returns the n minimum values of an array.Note: Returns the n smallest non-null elements in the array, in ascending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the n minimum values of the array.
-
arrayMaximum
Returns the maximum value of an array.- Returns:
- A new
Expressionrepresenting the maximum value of the array.
-
arrayMaximumN
Returns the n maximum values of an array.Note: Returns the n largest non-null elements in the array, in descending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
n- The number of elements to return.- Returns:
- A new
Expressionrepresenting the n maximum values of the array.
-
arrayMaximumN
Returns the n maximum values of an array.Note: Returns the n largest non-null elements in the array, in descending order. This does not use a stable sort, meaning the order of equivalent elements is undefined.
- Parameters:
n- The Expression evaluates to the number of elements to return.- Returns:
- A new
Expressionrepresenting the n maximum values of the array.
-
arrayIndexOf
Returns the index of the first occurrence of a value in an array.- Parameters:
value- The value to search for.- Returns:
- A new
Expressionrepresenting the index.
-
arrayIndexOf
Returns the index of the first occurrence of a value in an array.- Parameters:
value- The value to search for.- Returns:
- A new
Expressionrepresenting the index.
-
arrayLastIndexOf
Returns the index of the last occurrence of a value in an array.- Parameters:
value- The value to search for.- Returns:
- A new
Expressionrepresenting the last index.
-
arrayLastIndexOf
Returns the index of the last occurrence of a value in an array.- Parameters:
value- The value to search for.- Returns:
- A new
Expressionrepresenting the last index.
-
arrayIndexOfAll
Returns all indices of a value in an array.- Parameters:
value- The value to search for.- Returns:
- A new
Expressionrepresenting the indices.
-
arrayIndexOfAll
Returns all indices of a value in an array.- Parameters:
value- The value to search for.- Returns:
- A new
Expressionrepresenting the indices.
-
arrayReverse
Reverses the order of elements in the array.- Returns:
- A new
Expressionrepresenting the arrayReverse operation.
-
arrayFilter
Filters this array based on a predicate.- Parameters:
alias- The alias for the current element in the filter expression.filter- The predicate boolean expression used to filter the elements.- Returns:
- A new
Expressionrepresenting the filtered array.
-
arrayTransform
Creates an expression that applies a provided transformation to each element in an array.- Parameters:
elementAlias- The alias for the current element in the transform expression.transform- The expression used to transform the elements.- Returns:
- A new
Expressionrepresenting the transformed array.
-
arrayTransformWithIndex
public final Expression arrayTransformWithIndex(String elementAlias, String indexAlias, 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.- Parameters:
elementAlias- The alias for the current element in the transform expression.indexAlias- The alias for the current index.transform- The expression used to transform the elements.- Returns:
- A new
Expressionrepresenting the transformed array.
-
arraySlice
Returns a slice of this array.- Parameters:
offset- The starting index.length- The number of elements to return.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySlice
Returns a slice of this array.- Parameters:
offset- The starting index expressed as an Expression.length- The number of elements to return expressed as an Expression.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySliceToEnd
Returns a slice of this array to its end.- Parameters:
offset- The starting index.- Returns:
- A new
Expressionrepresenting the array slice.
-
arraySliceToEnd
Returns a slice of this array to its end.- Parameters:
offset- The starting index expressed as an Expression.- Returns:
- A new
Expressionrepresenting the array slice.
-
arrayContains
Creates an expression that checks if array contains a specificelement.- Parameters:
element- The element to search for in the array.- Returns:
- A new
BooleanExpressionrepresenting the arrayContains operation.
-
arrayContainsAll
Creates an expression that checks if array contains all the specifiedvalues.- Parameters:
values- The elements to check for in the array.- Returns:
- A new
BooleanExpressionrepresenting the arrayContainsAll operation.
-
arrayContainsAll
Creates an expression that checks if array contains all elements ofarrayExpression.- Parameters:
arrayExpression- The elements to check for in the array.- Returns:
- A new
BooleanExpressionrepresenting the arrayContainsAll operation.
-
arrayContainsAny
Creates an expression that checks if array contains any of the specifiedvalues.- Parameters:
values- The elements to check for in the array.- Returns:
- A new
BooleanExpressionrepresenting the arrayContainsAny operation.
-
arrayContainsAny
Creates an expression that checks if array contains any elements ofarrayExpression.- Parameters:
arrayExpression- The elements to check for in the array.- Returns:
- A new
BooleanExpressionrepresenting the arrayContainsAny operation.
-
arrayLength
Creates an expression that calculates the length of an array expression.- Returns:
- A new
Expressionrepresenting the length of the array.
-
arrayGet
Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.- Parameters:
offset- An Expression evaluating to the index of the element to return.- Returns:
- A new
Expressionrepresenting the arrayGet operation.
-
arrayGet
Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.- Parameters:
offset- An Expression evaluating to the index of the element to return.- Returns:
- A new
Expressionrepresenting the arrayOffset operation.
-
cosineDistance
Calculates the Cosine distance between this and another vector expressions.- Parameters:
vector- The other vector (represented as an Expression) to compare against.- Returns:
- A new
Expressionrepresenting the cosine distance between the two vectors.
-
cosineDistance
Calculates the Cosine distance between this vector expression and a vector literal.- Parameters:
vector- The other vector (as an array of doubles) to compare against.- Returns:
- A new
Expressionrepresenting the cosine distance between the two vectors.
-
dotProduct
Calculates the dot product distance between this and another vector expression.- Parameters:
vector- The other vector (represented as an Expression) to compare against.- Returns:
- A new
Expressionrepresenting the dot product distance between the two vectors.
-
dotProduct
Calculates the dot product distance between this vector expression and a vector literal.- Parameters:
vector- The other vector (as an array of doubles) to compare against.- Returns:
- A new
Expressionrepresenting the dot product distance between the two vectors.
-
euclideanDistance
Calculates the Euclidean distance between this and another vector expression.- Parameters:
vector- The other vector (represented as an Expression) to compare against.- Returns:
- A new
Expressionrepresenting the Euclidean distance between the two vectors.
-
euclideanDistance
Calculates the Euclidean distance between this vector expression and a vector literal.- Parameters:
vector- The other vector (as an array of doubles) to compare against.- Returns:
- A new
Expressionrepresenting the Euclidean distance between the two vectors.
-
vectorLength
Creates an expression that calculates the length (dimension) of a Firestore Vector.- Returns:
- A new
Expressionrepresenting the length (dimension) of the vector.
-
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.- Returns:
- A new
Expressionrepresenting the timestamp.
-
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).- Returns:
- A new
Expressionrepresenting the number of microseconds since epoch.
-
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.- Returns:
- A new
Expressionrepresenting the timestamp.
-
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).- Returns:
- A new
Expressionrepresenting the number of milliseconds since epoch.
-
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.- Returns:
- A new
Expressionrepresenting the timestamp.
-
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).- Returns:
- A new
Expressionrepresenting the number of seconds since epoch.
-
timestampAdd
Creates an expression that adds a specified amount of time to this timestamp expression.- Parameters:
unit- The expression representing the unit of time to add. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The expression representing the amount of time to add.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampAdd
Creates an expression that adds a specified amount of time to this timestamp expression.- Parameters:
unit- The unit of time to add. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The amount of time to add.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampSubtract
Creates an expression that subtracts a specified amount of time to this timestamp expression.- Parameters:
unit- The expression representing the unit of time to subtract. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The expression representing the amount of time to subtract.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampSubtract
Creates an expression that subtracts a specified amount of time to this timestamp expression.- Parameters:
unit- The unit of time to subtract. Valid units include "microsecond", "millisecond", "second", "minute", "hour" and "day".amount- The amount of time to subtract.- Returns:
- A new
Expressionrepresenting the resulting timestamp.
-
timestampTruncate
Creates an expression that truncates this timestamp expression to a specified granularity.- Parameters:
granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncate
Creates an expression that truncates this timestamp expression to a specified granularity.- Parameters:
granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.- Parameters:
granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.- Parameters:
granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.- Parameters:
granularity- The granularity to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampTruncateWithTimezone
Creates an expression that truncates this timestamp expression to a specified granularity in a given timezone.- Parameters:
granularity- The granularity expression to truncate to. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for truncation. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1".- Returns:
- A new
Expressionrepresenting the truncated timestamp.
-
timestampDiff
Calculates the difference between this timestamp and another timestamp.- Parameters:
start- The starting timestamp expression.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampDiff
Calculates the difference between this timestamp and another timestamp.- Parameters:
start- The starting timestamp expression.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampDiff
Calculates the difference between this timestamp and another timestamp.- Parameters:
startFieldName- The name of the field containing the starting timestamp.unit- The unit of time for the difference. Valid values include "microsecond", "millisecond", "second", "minute", "hour" and "day".- Returns:
- A new
Expressionrepresenting the difference.
-
timestampExtract
Creates an expression that extracts a specified part from this timestamp expression.- Parameters:
part- The part to extract. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtract
Creates an expression that extracts a specified part from this timestamp expression.- Parameters:
part- The part to extract. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
Creates an expression that extracts a specified part from this timestamp expression in a given timezone.- Parameters:
part- The part to extract. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for extraction. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
Creates an expression that extracts a specified part from this timestamp expression in a given timezone.- Parameters:
part- The part to extract. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone to use for extraction. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
Creates an expression that extracts a specified part from this timestamp expression in a given timezone.- Parameters:
part- The part to extract. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for extraction. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
timestampExtractWithTimezone
Creates an expression that extracts a specified part from this timestamp expression in a given timezone.- Parameters:
part- The part to extract. Valid values are "microsecond", "millisecond", "second", "minute", "hour", "dayofweek", "day", "dayofyear", "week", "week(monday)", "week(tuesday)", "week(wednesday)", "week(thursday)", "week(friday)", "week(saturday)", "week(sunday)", "isoweek", "month", "quarter", "year", and "isoyear".timezone- The timezone expression to use for extraction. Valid values are from the TZ database (e.g., "America/Los_Angeles") or in the format "Etc/GMT-1". Defaults to "UTC" if not specified.- Returns:
- A new
Expressionrepresenting the extracted part.
-
exists
Creates an expression that checks if this expression evaluates to a name of the field that exists.- Returns:
- A new
Expressionrepresenting the exists check.
-
ifError
Creates an expression that returns thecatchExprargument if there is an error, else return the result of this expression.- Parameters:
catchExpr- The catch expression that will be evaluated and returned if the this expression produces an error.- Returns:
- A new
Expressionrepresenting the ifError operation.
-
ifError
Creates an expression that returns thecatchValueargument if there is an error, else return the result of this expression.- Parameters:
catchValue- The value that will be returned if this expression produces an error.- Returns:
- A new
Expressionrepresenting the ifError operation.
-
isError
Creates an expression that checks if this expression produces an error.- Returns:
- A new
BooleanExpressionrepresenting the `isError` check.
-
documentId
Creates an expression that returns the document ID from this path expression.- Returns:
- A new
Expressionrepresenting the documentId operation.
-
collectionId
Creates an expression that returns the collection ID from this path expression.- Returns:
- A new
Expressionrepresenting the collectionId operation.
-
parent
Creates an expression that returns the parent document of a document reference.- Returns:
- A new
Expressionrepresenting the parent operation.
-
type
Creates an expression that returns a string indicating the type of the value this expression evaluates to.- Returns:
- A new
Expressionrepresenting the type operation.
-
currentDocument
Creates an expression that represents the current document being processed.This expression is useful when you need to access the entire document as a map, or pass the document itself to a function or subquery.
Example:
// Define the current document as a variable "doc" firestore.pipeline().collection("books") .define(currentDocument().as("doc")) // Access a field from the defined document variable .select(variable("doc").getField("title"));- Returns:
- An
Expressionrepresenting the current document.
-
variable
Creates an expression that retrieves the value of a variable bound viaPipeline.define(AliasedExpression, AliasedExpression...).Example:
// Define a variable "discountedPrice" and use it in a filter firestore.pipeline().collection("products") .define(field("price").multiply(0.9).as("discountedPrice")) .where(variable("discountedPrice").lessThan(100));- Parameters:
name- The name of the variable to retrieve.- Returns:
- An
Expressionrepresenting the variable's value.
-
getField
Accesses a field/property of the expression that evaluates to a Map or Document.- Parameters:
key- The key of the field to access.- Returns:
- An
Expressionrepresenting the value of the field.
-
getField
Retrieves the value of a specific field from the document evaluated by this expression.- Parameters:
keyExpression- The expression evaluating to the key to access.- Returns:
- A new
Expressionrepresenting the field value.
-
getField
Accesses a field/property of a document field using the providedkey.- Parameters:
fieldName- The field name of the map or document field.key- The key of the field to access.- Returns:
- An
Expressionrepresenting the value of the field.
-
getField
Accesses a field/property of the expression using the providedkeyExpression.- Parameters:
expression- The expression evaluating to a Map or Document.keyExpression- The expression evaluating to the key.- Returns:
- A new
Expressionrepresenting the value of the field.
-
getField
Accesses a field/property of a document field using the providedkeyExpression.- Parameters:
fieldName- The field name of the map or document field.keyExpression- The expression evaluating to the key.- Returns:
- A new
Expressionrepresenting the value of the field.
-
getField
Accesses a field/property of the expression that evaluates to a Map or Document.- Parameters:
expression- The expression evaluating to a map/document.key- The key of the field to access.- Returns:
- An
Expressionrepresenting the value of the field.
-
isType
Creates an expression that checks if the result of this expression is of the given type.Supported values for
typeare: "null", "array", "boolean", "bytes", "timestamp", "geo_point", "number", "int32", "int64", "float64", "decimal128", "map", "reference", "string", "vector", "max_key", "min_key", "object_id", "regex", and "request_timestamp".- Parameters:
type- The type to check for.- Returns:
- A new
BooleanExpressionthat evaluates to true if the expression's result is of the given type, false otherwise.
-