Expression class abstract
A value computed by the server while it runs a pipeline: a Field reference, a Constant, or a FunctionExpression over other expressions.
Wherever a method takes an Object? operand, an Expression is used as is
and any other value is treated as a constant.
Preview, Enterprise only: the Pipelines API is experimental, may change in any release and needs a Firestore Enterprise edition database.
- Implementers
Constructors
- Expression()
- Constructor for subclasses.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
abs(
) → FunctionExpression - The absolute value of this number.
-
add(
Object? other) → FunctionExpression -
Adds
otherto this expression. -
arrayAgg(
) → AggregateFunction - All values of this expression, as an array.
-
arrayAggDistinct(
) → AggregateFunction - The distinct values of this expression, as an array.
-
arrayConcat(
List< Object?> others) → FunctionExpression -
This array followed by the elements of the arrays in
others. -
arrayContains(
Object? element) → BooleanExpression -
Whether this array contains
element. -
arrayContainsAll(
Object values) → BooleanExpression -
Whether this array contains all of
values, aListof values or expressions, or an Expression that evaluates to an array. -
arrayContainsAny(
Object values) → BooleanExpression -
Whether this array contains at least one of
values, aListof values or expressions, or an Expression that evaluates to an array. -
arrayFilter(
BooleanExpression filter(Expression element), {String alias = 'element'}) → FunctionExpression -
The elements of this array for which
filterholds. -
arrayFirst(
) → FunctionExpression - The first element of this array.
-
arrayFirstN(
Object n) → FunctionExpression -
The first
nelements of this array. -
arrayGet(
Object index) → FunctionExpression -
The element at
indexof this array (negative counts from the end). -
arrayIndexOf(
Object? search) → FunctionExpression -
The position of the first occurrence of
searchin this array, or -1. -
arrayIndexOfAll(
Object? search) → FunctionExpression -
The positions of all occurrences of
searchin this array. -
arrayLast(
) → FunctionExpression - The last element of this array.
-
arrayLastIndexOf(
Object? search) → FunctionExpression -
The position of the last occurrence of
searchin this array, or -1. -
arrayLastN(
Object n) → FunctionExpression -
The last
nelements of this array. -
arrayLength(
) → FunctionExpression - The number of elements of this array.
-
arrayMaximum(
) → FunctionExpression - The largest element of this array.
-
arrayMaximumN(
Object n) → FunctionExpression -
The
nlargest elements of this array, largest first. -
arrayMinimum(
) → FunctionExpression - The smallest element of this array.
-
arrayMinimumN(
Object n) → FunctionExpression -
The
nsmallest elements of this array, smallest first. -
arrayReverse(
) → FunctionExpression - This array in reverse order.
-
arraySlice(
Object offset, [Object? length]) → FunctionExpression -
The elements of this array from
offset, at mostlengthof them. -
arraySum(
) → FunctionExpression - The sum of the numeric elements of this array.
-
arrayTransform(
Object? transform(Expression element), {String alias = 'element'}) → FunctionExpression -
This array with every element replaced by the result of
transform. -
arrayTransformWithIndex(
Object? transform(Expression element, Expression index), {String elementAlias = 'element', String indexAlias = 'index'}) → FunctionExpression -
Like arrayTransform, but
transformalso receives an expression for the position of the element in the array. -
as(
String alias) → AliasedExpression -
Gives this expression a name, for use in
select,addFieldsanddistinct. -
asBoolean(
) → BooleanExpression - Treats this expression as a boolean, so that it can be used as a condition (for example a field that holds a boolean).
-
ascending(
) → Ordering - Sorts by this expression, smallest first.
-
average(
) → AggregateFunction - Averages the values of this expression.
-
byteLength(
) → FunctionExpression - The number of bytes of this string (in UTF-8) or of these bytes.
-
ceil(
) → FunctionExpression - This number rounded up to a whole number.
-
charLength(
) → FunctionExpression - The number of characters of this string.
-
coalesce(
Object? replacement, [List< Object?> others = const <Object?>[]]) → FunctionExpression -
The first of this value,
replacementandothersthat is neither null nor absent. -
collectionId(
) → FunctionExpression - The id of the collection of this document reference.
-
concat(
List< Object?> others) → FunctionExpression -
This value concatenated with
others(strings, arrays or bytes). -
cosineDistance(
Object other) → FunctionExpression -
The cosine distance between this vector and
other(aVectorValue, aList<double>or an expression). -
count(
) → AggregateFunction - Counts the inputs for which this expression has a value.
-
countDistinct(
) → AggregateFunction - Counts the distinct values of this expression.
-
descending(
) → Ordering - Sorts by this expression, largest first.
-
divide(
Object? other) → FunctionExpression -
Divides this expression by
other. -
documentId(
) → FunctionExpression - The document id of this document reference (or document path).
-
dotProduct(
Object other) → FunctionExpression -
The dot product of this vector and
other; see cosineDistance. -
endsWith(
Object suffix) → BooleanExpression -
Whether this string ends with
suffix. -
equal(
Object? other) → BooleanExpression -
Whether this expression is equal to
other. -
equalAny(
Object values) → BooleanExpression -
Whether this expression is equal to any of
values, aListof values or expressions, or an Expression that evaluates to an array. -
euclideanDistance(
Object other) → FunctionExpression -
The Euclidean distance between this vector and
other; see cosineDistance. -
exists(
) → BooleanExpression - Whether this expression (usually a Field) has a value in the document.
-
exp(
) → FunctionExpression - Euler's number raised to the power of this number.
-
first(
) → AggregateFunction - The value of this expression for the first input.
-
floor(
) → FunctionExpression - This number rounded down to a whole number.
-
geoDistance(
Object location) → FunctionExpression -
The distance in meters between this location and
location(aGeoPointor an expression). -
getField(
Object key) → FunctionExpression -
The value of the field
keyof this map or document, for example ofcurrentDocument()or of a variable that holds a document. -
greaterThan(
Object? other) → BooleanExpression -
Whether this expression is greater than
other. -
greaterThanOrEqual(
Object? other) → BooleanExpression -
Whether this expression is greater than or equal to
other. -
ifAbsent(
Object? elseValue) → FunctionExpression -
This value, or
elseValueif it is absent. -
ifError(
Object? catchValue) → FunctionExpression -
This value, or
catchValueif evaluating it fails. -
ifNull(
Object? elseValue) → FunctionExpression -
This value, or
elseValueif it is null. -
isAbsent(
) → BooleanExpression - Whether this expression has no value in the document.
-
isError(
) → BooleanExpression - Whether evaluating this expression produces an error.
-
isType(
String type) → BooleanExpression -
Whether this value is of the type with the name
type. -
join(
Object delimiter) → FunctionExpression -
The elements of this array of strings, joined with
delimiter. -
last(
) → AggregateFunction - The value of this expression for the last input.
-
length(
) → FunctionExpression - The length of this string, array, map, vector or bytes value.
-
lessThan(
Object? other) → BooleanExpression -
Whether this expression is less than
other. -
lessThanOrEqual(
Object? other) → BooleanExpression -
Whether this expression is less than or equal to
other. -
like(
Object pattern) → BooleanExpression -
Whether this string matches the SQL-style
LIKEpattern. -
ln(
) → FunctionExpression - The natural logarithm of this number.
-
log(
Object base) → FunctionExpression -
The logarithm of this number to the given
base. -
log10(
) → FunctionExpression - The base 10 logarithm of this number.
-
logicalMaximum(
List< Object?> others) → FunctionExpression -
The largest of this value and
others, in Firestore's value ordering. -
logicalMinimum(
List< Object?> others) → FunctionExpression -
The smallest of this value and
others, in Firestore's value ordering. -
ltrim(
[Object? characters]) → FunctionExpression - Like trim, for the start of the string only.
-
mapEntries(
) → FunctionExpression -
The entries of this map, as an array of maps with
kandv. -
mapGet(
String key) → FunctionExpression -
The value stored under
keyin this map. -
mapKeys(
) → FunctionExpression - The keys of this map.
-
mapMerge(
Object second, [List< Object> others = const <Object>[]]) → FunctionExpression -
This map merged with
secondandothers; later maps win. -
mapRemove(
Object key) → FunctionExpression -
This map without the entry for
key. -
mapSet(
Object key, Object? value, [List< Object?> moreKeyValues = const <Object?>[]]) → FunctionExpression -
This map with
keyset tovalue. -
mapValues(
) → FunctionExpression - The values of this map.
-
maximum(
) → AggregateFunction - The largest value of this expression.
-
minimum(
) → AggregateFunction - The smallest value of this expression.
-
mod(
Object? other) → FunctionExpression -
The remainder of dividing this expression by
other. -
multiply(
Object? other) → FunctionExpression -
Multiplies this expression by
other. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notEqual(
Object? other) → BooleanExpression -
Whether this expression is not equal to
other. -
notEqualAny(
Object values) → BooleanExpression -
Whether this expression is equal to none of
values, aListof values or expressions, or an Expression that evaluates to an array. -
parent(
) → FunctionExpression - The parent of this document reference.
-
pow(
Object exponent) → FunctionExpression -
This number raised to the power
exponent. -
regexContains(
Object pattern) → BooleanExpression -
Whether a part of this string matches the regular expression
pattern. -
regexFind(
Object pattern) → FunctionExpression -
The first part of this string that matches the regular expression
pattern. -
regexFindAll(
Object pattern) → FunctionExpression -
All parts of this string that match the regular expression
pattern. -
regexMatch(
Object pattern) → BooleanExpression -
Whether the whole string matches the regular expression
pattern. -
reverse(
) → FunctionExpression - This string, array or bytes value in reverse order.
-
round(
[Object? decimalPlaces]) → FunctionExpression -
This number rounded to
decimalPlaces(to a whole number without it). -
rtrim(
[Object? characters]) → FunctionExpression - Like trim, for the end of the string only.
-
split(
Object delimiter) → FunctionExpression -
The parts of this string between occurrences of
delimiter. -
sqrt(
) → FunctionExpression - The square root of this number.
-
startsWith(
Object prefix) → BooleanExpression -
Whether this string starts with
prefix. -
stringConcat(
List< Object?> others) → FunctionExpression -
Concatenates this string with
others. -
stringContains(
Object substring) → BooleanExpression -
Whether this string contains
substring. -
stringIndexOf(
Object search) → FunctionExpression -
The position of the first occurrence of
searchin this string, or -1. -
stringRepeat(
Object repetitions) → FunctionExpression -
This string repeated
repetitionstimes. -
stringReplaceAll(
Object find, Object replacement) → FunctionExpression -
This string with every occurrence of
findreplaced byreplacement. -
stringReplaceOne(
Object find, Object replacement) → FunctionExpression -
This string with the first occurrence of
findreplaced byreplacement. -
stringReverse(
) → FunctionExpression - This string with its characters in reverse order.
-
substring(
Object position, [Object? length]) → FunctionExpression -
The part of this string that starts at
position(0-based) and haslengthcharacters, or runs to the end withoutlength. -
subtract(
Object? other) → FunctionExpression -
Subtracts
otherfrom this expression. -
sum(
) → AggregateFunction - Sums the values of this expression.
-
timestampAdd(
Object unit, Object amount) → FunctionExpression -
This timestamp plus
amountofunit('microsecond','millisecond','second','minute','hour'or'day'). -
timestampDiff(
Object start, Object unit) → FunctionExpression -
The number of whole
units fromstart(a field name or an expression) to this timestamp. -
timestampExtract(
Object part, [Object? timezone]) → FunctionExpression -
The
part(for example'year'or'dayofweek') of this timestamp, optionally intimezone. -
timestampSubtract(
Object unit, Object amount) → FunctionExpression -
This timestamp minus
amountofunit; see timestampAdd. -
timestampToUnixMicros(
) → FunctionExpression - This timestamp as microseconds since the Unix epoch.
-
timestampToUnixMillis(
) → FunctionExpression - This timestamp as milliseconds since the Unix epoch.
-
timestampToUnixSeconds(
) → FunctionExpression - This timestamp as seconds since the Unix epoch.
-
timestampTruncate(
Object granularity, [Object? timezone]) → FunctionExpression -
This timestamp truncated to
granularity(for example'day'), optionally intimezone. -
toLower(
) → FunctionExpression - This string in lower case.
-
toString(
) → String -
A string representation of this object.
inherited
-
toUpper(
) → FunctionExpression - This string in upper case.
-
trim(
[Object? characters]) → FunctionExpression -
This string without leading and trailing whitespace, or without the
leading and trailing characters of
characterswhen given. -
trunc(
[Object? decimalPlaces]) → FunctionExpression -
This number cut off after
decimalPlaces(at the decimal point without it). -
type(
) → FunctionExpression -
The name of the type of this value (for example
'string'). -
unixMicrosToTimestamp(
) → FunctionExpression - The timestamp this number of microseconds after the Unix epoch.
-
unixMillisToTimestamp(
) → FunctionExpression - The timestamp this number of milliseconds after the Unix epoch.
-
unixSecondsToTimestamp(
) → FunctionExpression - The timestamp this number of seconds after the Unix epoch.
-
vectorLength(
) → FunctionExpression - The number of dimensions of this vector.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited