FirebaseFirestore Framework Reference Stay organized with collections Save and categorize content based on your preferences.
Field
publicstructField:Expression,Selectable,BridgeWrapper,SelectableWrapper,@uncheckedSendableAField is anExpression that represents a field in a Firestore document.
It is a central component for building queries and transformations in Firestore pipelines.AField can be used to:
- Reference a document field by its name or
FieldPath. - Create complex
BooleanExpressions for filtering in awhereclause. - Perform mathematical operations on numeric fields.
- Manipulate string and array fields.
Example of creating aField and using it in awhere clause:
// Reference the "price" field in a documentletpriceField=Field("price")// Create a query to find products where the price is greater than 100firestore.pipeline().collection("products").where(priceField.greaterThan(100))The name of the field.
Declaration
Swift
publicletfieldName:StringCreates a new
Fieldexpression from a field name.Declaration
Swift
publicinit(_name:String)Parameters
nameThe name of the field.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-13 UTC.