FirebaseFirestore Framework Reference

ArrayExpression

public class ArrayExpression : FunctionExpression, @unchecked Sendable

An expression that represents an array of values.

ArrayExpression is used to construct an array from a list of Sendable values, which can include literals (like numbers and strings) as well as other Expression instances. This allows for the creation of dynamic arrays within a pipeline.

Example:

ArrayExpression([
  1,
  2,
  Field("genre"),
  Field("rating").multiply(10),
  ArrayExpression([Field("title")]),
  MapExpression(["published": Field("published")]),
]).as("metadataArray")
  • Undocumented

    Declaration

    Swift

    public init(_ elements: [Sendable])