Variable
public struct Variable : Expression, BridgeWrapperA Variable is an Expression that retrieves the value of a variable bound via
Pipeline.define.
Variables are typically defined in a define stage and can be referenced in subsequent
stages.
Example:
firestore.pipeline().collection("products")
.define([Field("price").multiply(0.9).as("discountedPrice")])
.where(Variable("discountedPrice") < 100)
.select([Field("name"), Variable("discountedPrice")])
-
Creates a new
Variableexpression from a variable name.Declaration
Swift
public init(_ name: String)Parameters
nameThe name of the variable.