Field class

A reference to a field of the input document.

Preview, Enterprise only: the Pipelines API is experimental, may change in any release and needs a Firestore Enterprise edition database.

Inheritance
Implemented types

Constructors

Field.of(Object nameOrPath)
Creates a field reference from a dot-separated String or a FieldPath. __name__ refers to the document name.
factory

Properties

alias → String
The name of the output field.
no setteroverride
expression → Expression
The expression that produces the value.
no setteroverride
fieldName → String
The dot-separated (and escaped where needed) name of the field.
no setter
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

abs() → FunctionExpression
The absolute value of this number.
inherited
add(Object? other) → FunctionExpression
Adds other to this expression.
inherited
arrayAgg() → AggregateFunction
All values of this expression, as an array.
inherited
arrayAggDistinct() → AggregateFunction
The distinct values of this expression, as an array.
inherited
arrayConcat(List<Object?> others) → FunctionExpression
This array followed by the elements of the arrays in others.
inherited
arrayContains(Object? element) → BooleanExpression
Whether this array contains element.
inherited
arrayContainsAll(Object values) → BooleanExpression
Whether this array contains all of values, a List of values or expressions, or an Expression that evaluates to an array.
inherited
arrayContainsAny(Object values) → BooleanExpression
Whether this array contains at least one of values, a List of values or expressions, or an Expression that evaluates to an array.
inherited
arrayFilter(BooleanExpression filter(Expression element), {String alias = 'element'}) → FunctionExpression
The elements of this array for which filter holds.
inherited
arrayFirst() → FunctionExpression
The first element of this array.
inherited
arrayFirstN(Object n) → FunctionExpression
The first n elements of this array.
inherited
arrayGet(Object index) → FunctionExpression
The element at index of this array (negative counts from the end).
inherited
arrayIndexOf(Object? search) → FunctionExpression
The position of the first occurrence of search in this array, or -1.
inherited
arrayIndexOfAll(Object? search) → FunctionExpression
The positions of all occurrences of search in this array.
inherited
arrayLast() → FunctionExpression
The last element of this array.
inherited
arrayLastIndexOf(Object? search) → FunctionExpression
The position of the last occurrence of search in this array, or -1.
inherited
arrayLastN(Object n) → FunctionExpression
The last n elements of this array.
inherited
arrayLength() → FunctionExpression
The number of elements of this array.
inherited
arrayMaximum() → FunctionExpression
The largest element of this array.
inherited
arrayMaximumN(Object n) → FunctionExpression
The n largest elements of this array, largest first.
inherited
arrayMinimum() → FunctionExpression
The smallest element of this array.
inherited
arrayMinimumN(Object n) → FunctionExpression
The n smallest elements of this array, smallest first.
inherited
arrayReverse() → FunctionExpression
This array in reverse order.
inherited
arraySlice(Object offset, [Object? length]) → FunctionExpression
The elements of this array from offset, at most length of them.
inherited
arraySum() → FunctionExpression
The sum of the numeric elements of this array.
inherited
arrayTransform(Object? transform(Expression element), {String alias = 'element'}) → FunctionExpression
This array with every element replaced by the result of transform.
inherited
arrayTransformWithIndex(Object? transform(Expression element, Expression index), {String elementAlias = 'element', String indexAlias = 'index'}) → FunctionExpression
Like arrayTransform, but transform also receives an expression for the position of the element in the array.
inherited
as(String alias) → AliasedExpression
Gives this expression a name, for use in select, addFields and distinct.
inherited
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).
inherited
ascending() → Ordering
Sorts by this expression, smallest first.
inherited
average() → AggregateFunction
Averages the values of this expression.
inherited
byteLength() → FunctionExpression
The number of bytes of this string (in UTF-8) or of these bytes.
inherited
ceil() → FunctionExpression
This number rounded up to a whole number.
inherited
charLength() → FunctionExpression
The number of characters of this string.
inherited
coalesce(Object? replacement, [List<Object?> others = const <Object?>[]]) → FunctionExpression
The first of this value, replacement and others that is neither null nor absent.
inherited
collectionId() → FunctionExpression
The id of the collection of this document reference.
inherited
concat(List<Object?> others) → FunctionExpression
This value concatenated with others (strings, arrays or bytes).
inherited
cosineDistance(Object other) → FunctionExpression
The cosine distance between this vector and other (a VectorValue, a List<double> or an expression).
inherited
count() → AggregateFunction
Counts the inputs for which this expression has a value.
inherited
countDistinct() → AggregateFunction
Counts the distinct values of this expression.
inherited
descending() → Ordering
Sorts by this expression, largest first.
inherited
divide(Object? other) → FunctionExpression
Divides this expression by other.
inherited
documentId() → FunctionExpression
The document id of this document reference (or document path).
inherited
dotProduct(Object other) → FunctionExpression
The dot product of this vector and other; see cosineDistance.
inherited
endsWith(Object suffix) → BooleanExpression
Whether this string ends with suffix.
inherited
equal(Object? other) → BooleanExpression
Whether this expression is equal to other.
inherited
equalAny(Object values) → BooleanExpression
Whether this expression is equal to any of values, a List of values or expressions, or an Expression that evaluates to an array.
inherited
euclideanDistance(Object other) → FunctionExpression
The Euclidean distance between this vector and other; see cosineDistance.
inherited
exists() → BooleanExpression
Whether this expression (usually a Field) has a value in the document.
inherited
exp() → FunctionExpression
Euler's number raised to the power of this number.
inherited
first() → AggregateFunction
The value of this expression for the first input.
inherited
floor() → FunctionExpression
This number rounded down to a whole number.
inherited
geoDistance(Object location) → FunctionExpression
The distance in meters between this location and location (a GeoPoint or an expression).
inherited
getField(Object key) → FunctionExpression
The value of the field key of this map or document, for example of currentDocument() or of a variable that holds a document.
inherited
greaterThan(Object? other) → BooleanExpression
Whether this expression is greater than other.
inherited
greaterThanOrEqual(Object? other) → BooleanExpression
Whether this expression is greater than or equal to other.
inherited
ifAbsent(Object? elseValue) → FunctionExpression
This value, or elseValue if it is absent.
inherited
ifError(Object? catchValue) → FunctionExpression
This value, or catchValue if evaluating it fails.
inherited
ifNull(Object? elseValue) → FunctionExpression
This value, or elseValue if it is null.
inherited
isAbsent() → BooleanExpression
Whether this expression has no value in the document.
inherited
isError() → BooleanExpression
Whether evaluating this expression produces an error.
inherited
isType(String type) → BooleanExpression
Whether this value is of the type with the name type.
inherited
join(Object delimiter) → FunctionExpression
The elements of this array of strings, joined with delimiter.
inherited
last() → AggregateFunction
The value of this expression for the last input.
inherited
length() → FunctionExpression
The length of this string, array, map, vector or bytes value.
inherited
lessThan(Object? other) → BooleanExpression
Whether this expression is less than other.
inherited
lessThanOrEqual(Object? other) → BooleanExpression
Whether this expression is less than or equal to other.
inherited
like(Object pattern) → BooleanExpression
Whether this string matches the SQL-style LIKE pattern.
inherited
ln() → FunctionExpression
The natural logarithm of this number.
inherited
log(Object base) → FunctionExpression
The logarithm of this number to the given base.
inherited
log10() → FunctionExpression
The base 10 logarithm of this number.
inherited
logicalMaximum(List<Object?> others) → FunctionExpression
The largest of this value and others, in Firestore's value ordering.
inherited
logicalMinimum(List<Object?> others) → FunctionExpression
The smallest of this value and others, in Firestore's value ordering.
inherited
ltrim([Object? characters]) → FunctionExpression
Like trim, for the start of the string only.
inherited
mapEntries() → FunctionExpression
The entries of this map, as an array of maps with k and v.
inherited
mapGet(String key) → FunctionExpression
The value stored under key in this map.
inherited
mapKeys() → FunctionExpression
The keys of this map.
inherited
mapMerge(Object second, [List<Object> others = const <Object>[]]) → FunctionExpression
This map merged with second and others; later maps win.
inherited
mapRemove(Object key) → FunctionExpression
This map without the entry for key.
inherited
mapSet(Object key, Object? value, [List<Object?> moreKeyValues = const <Object?>[]]) → FunctionExpression
This map with key set to value.
inherited
mapValues() → FunctionExpression
The values of this map.
inherited
maximum() → AggregateFunction
The largest value of this expression.
inherited
minimum() → AggregateFunction
The smallest value of this expression.
inherited
mod(Object? other) → FunctionExpression
The remainder of dividing this expression by other.
inherited
multiply(Object? other) → FunctionExpression
Multiplies this expression by other.
inherited
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.
inherited
notEqualAny(Object values) → BooleanExpression
Whether this expression is equal to none of values, a List of values or expressions, or an Expression that evaluates to an array.
inherited
parent() → FunctionExpression
The parent of this document reference.
inherited
pow(Object exponent) → FunctionExpression
This number raised to the power exponent.
inherited
regexContains(Object pattern) → BooleanExpression
Whether a part of this string matches the regular expression pattern.
inherited
regexFind(Object pattern) → FunctionExpression
The first part of this string that matches the regular expression pattern.
inherited
regexFindAll(Object pattern) → FunctionExpression
All parts of this string that match the regular expression pattern.
inherited
regexMatch(Object pattern) → BooleanExpression
Whether the whole string matches the regular expression pattern.
inherited
reverse() → FunctionExpression
This string, array or bytes value in reverse order.
inherited
round([Object? decimalPlaces]) → FunctionExpression
This number rounded to decimalPlaces (to a whole number without it).
inherited
rtrim([Object? characters]) → FunctionExpression
Like trim, for the end of the string only.
inherited
split(Object delimiter) → FunctionExpression
The parts of this string between occurrences of delimiter.
inherited
sqrt() → FunctionExpression
The square root of this number.
inherited
startsWith(Object prefix) → BooleanExpression
Whether this string starts with prefix.
inherited
stringConcat(List<Object?> others) → FunctionExpression
Concatenates this string with others.
inherited
stringContains(Object substring) → BooleanExpression
Whether this string contains substring.
inherited
stringIndexOf(Object search) → FunctionExpression
The position of the first occurrence of search in this string, or -1.
inherited
stringRepeat(Object repetitions) → FunctionExpression
This string repeated repetitions times.
inherited
stringReplaceAll(Object find, Object replacement) → FunctionExpression
This string with every occurrence of find replaced by replacement.
inherited
stringReplaceOne(Object find, Object replacement) → FunctionExpression
This string with the first occurrence of find replaced by replacement.
inherited
stringReverse() → FunctionExpression
This string with its characters in reverse order.
inherited
substring(Object position, [Object? length]) → FunctionExpression
The part of this string that starts at position (0-based) and has length characters, or runs to the end without length.
inherited
subtract(Object? other) → FunctionExpression
Subtracts other from this expression.
inherited
sum() → AggregateFunction
Sums the values of this expression.
inherited
timestampAdd(Object unit, Object amount) → FunctionExpression
This timestamp plus amount of unit ('microsecond', 'millisecond', 'second', 'minute', 'hour' or 'day').
inherited
timestampDiff(Object start, Object unit) → FunctionExpression
The number of whole units from start (a field name or an expression) to this timestamp.
inherited
timestampExtract(Object part, [Object? timezone]) → FunctionExpression
The part (for example 'year' or 'dayofweek') of this timestamp, optionally in timezone.
inherited
timestampSubtract(Object unit, Object amount) → FunctionExpression
This timestamp minus amount of unit; see timestampAdd.
inherited
timestampToUnixMicros() → FunctionExpression
This timestamp as microseconds since the Unix epoch.
inherited
timestampToUnixMillis() → FunctionExpression
This timestamp as milliseconds since the Unix epoch.
inherited
timestampToUnixSeconds() → FunctionExpression
This timestamp as seconds since the Unix epoch.
inherited
timestampTruncate(Object granularity, [Object? timezone]) → FunctionExpression
This timestamp truncated to granularity (for example 'day'), optionally in timezone.
inherited
toLower() → FunctionExpression
This string in lower case.
inherited
toProto(PipelineEncoder encoder) → Value
Returns the wire representation of this expression.
toString() → String
A string representation of this object.
override
toUpper() → FunctionExpression
This string in upper case.
inherited
trim([Object? characters]) → FunctionExpression
This string without leading and trailing whitespace, or without the leading and trailing characters of characters when given.
inherited
trunc([Object? decimalPlaces]) → FunctionExpression
This number cut off after decimalPlaces (at the decimal point without it).
inherited
type() → FunctionExpression
The name of the type of this value (for example 'string').
inherited
unixMicrosToTimestamp() → FunctionExpression
The timestamp this number of microseconds after the Unix epoch.
inherited
unixMillisToTimestamp() → FunctionExpression
The timestamp this number of milliseconds after the Unix epoch.
inherited
unixSecondsToTimestamp() → FunctionExpression
The timestamp this number of seconds after the Unix epoch.
inherited
vectorLength() → FunctionExpression
The number of dimensions of this vector.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

documentIdName → const String
The field name that refers to the document name (key).