FirebaseFirestore Framework Reference Stay organized with collections Save and categorize content based on your preferences.
Classes
The following classes are available globally.
Represents an aggregation that can be performed by Firestore.
Declaration
Objective-C
@interfaceFIRAggregateField:NSObjectA query that calculates aggregations over an underlying query.
Declaration
Objective-C
@interfaceFIRAggregateQuery:NSObjectThe results of executing an
AggregateQuery.Declaration
Objective-C
@interfaceFIRAggregateQuerySnapshot:NSObjectA
CollectionReferenceobject can be used for adding documents, getting document references,and querying for documents (using the methods inherited fromQuery).Declaration
Objective-C
@interfaceFIRCollectionReference:FIRQueryA
DocumentChangerepresents a change to the documents matching a query. It contains thedocument affected and the type of change that occurred (added, modified, or removed).Declaration
Objective-C
@interfaceFIRDocumentChange:NSObjectA
DocumentReferencerefers to a document location in a Firestore database and can beused to write, read, or listen to the location. The document at the referenced locationmay or may not exist. ADocumentReferencecan also be used to create aCollectionReferencetoa subcollection.Declaration
Objective-C
@interfaceFIRDocumentReference:NSObjectA
DocumentSnapshotcontains data read from a document in your Firestore database. The data can be extracted with thedataproperty or by using subscript syntax to access a specific field.For a
DocumentSnapshotthat points to a non-existing document, any data access will returnnil. You can use theexistsproperty to explicitly verify a documents existence.Declaration
Objective-C
@interfaceFIRDocumentSnapshot:NSObjectA
QueryDocumentSnapshotcontains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with thedataproperty or by using subscript syntax to access a specific field.A
QueryDocumentSnapshotoffers the same API surface as aDocumentSnapshot. As deleted documents are not returned from queries, itsexistsproperty will always be true anddata()will never returnnil.Declaration
Objective-C
@interfaceFIRQueryDocumentSnapshot:FIRDocumentSnapshotA
FieldPathrefers to a field in a document. The path may consist of a single field name(referring to a top level field in the document), or a list of field names (referring to a nestedfield in the document).Declaration
Objective-C
@interfaceFIRFieldPath:NSObject<NSCopying>Sentinel values that can be used when writing document fields with
setData()orupdateData().Declaration
Objective-C
@interfaceFIRFieldValue:NSObjectA Filter represents a restriction on one or more field values and can be used to refinethe results of a Query.
Declaration
Objective-C
@interfaceFIRFilter:NSObjectFirestorerepresents a Firestore Database and is the entry point for all Firestoreoperations.Declaration
Objective-C
@interfaceFIRFirestore:NSObjectSettings used to configure a
Firestoreinstance.Declaration
Objective-C
@interfaceFIRFirestoreSettings:NSObject<NSCopying>An immutable object representing a geographical point in Firestore. The point is represented as a latitude/longitude pair.
Latitude values are in the range of [-90, 90]. Longitude values are in the range of [-180, 180].
Declaration
Objective-C
@interfaceFIRGeoPoint:NSObject<NSCopying>Represents a progress update or a final state from loading bundles.
Declaration
Objective-C
@interfaceFIRLoadBundleTaskProgress:NSObjectRepresents the task of loading a Firestore bundle. Observers can be registered with this task toobserve the bundle loading progress, as well as task completion and error events.
Declaration
Objective-C
@interfaceFIRLoadBundleTask:NSObjectConfigures the SDK to use a persistent cache. Firestore documents and mutations are persisted across App restart.
This is the default cache type unless explicitly specified otherwise.
To use, create an instance using one of the initializers, then set the instance to
FirestoreSettings.cacheSettings, and useFirestoreSettingsinstance to configure Firestore SDK.Declaration
Objective-C
@interfaceFIRPersistentCacheSettings:NSObject<NSCopying,FIRLocalCacheSettings>Configures the SDK to use an eager garbage collector for memory cache.
Once configured, the SDK will remove any Firestore documents from memory as soon as they are not used by any active queries.
To use, create an instance using the initializer, then initialize
MemoryCacheSettingswith this instance. This is the default garbage collector, so alternatively you can use the default initializer ofMemoryCacheSettings.Declaration
Objective-C
@interfaceFIRMemoryEagerGCSettings:NSObject<NSCopying,FIRMemoryGarbageCollectorSettings>Configures the SDK to use a least-recently-used garbage collector for memory cache.
Once configured, the SDK will attempt to remove documents that are least recently used in batches, if the current cache size is larger than the given target cache size. Default cache size is 100MB.
To use, create an instance using one of the initializers, then initialize
MemoryCacheSettingswith this instance.Declaration
Objective-C
@interfaceFIRMemoryLRUGCSettings:NSObject<NSCopying,FIRMemoryGarbageCollectorSettings>Configures the SDK to use a memory cache. Firestore documents and mutations are NOT persisted across App restart.
To use, create an instance using one of the initializer, then set the instance to
FirestoreSettings.cacheSettings, and useFirestoreSettingsinstance to configure Firestore SDK.Declaration
Objective-C
@interfaceFIRMemoryCacheSettings:NSObject<NSCopying,FIRLocalCacheSettings>A
Queryrefers to a query which you can read or listen to. You can also constructrefinedQueryobjects by adding filters and ordering.Declaration
Objective-C
@interfaceFIRQuery:NSObjectA
QuerySnapshotcontains zero or moreDocumentSnapshotobjects. It can be enumeratedusing thedocumentsproperty and its size can be inspected withisEmptyandcount.Declaration
Objective-C
@interfaceFIRQuerySnapshot:NSObjectOptions to configure the behavior of
Firestore.addSnapshotListenerWithOptions(). Instancesof this class control settings like whether metadata-only changes trigger events and thepreferred data source.Declaration
Objective-C
@interfaceFIRSnapshotListenOptions:NSObjectMetadata about a snapshot, describing the state of the snapshot.
Declaration
Objective-C
@interfaceFIRSnapshotMetadata:NSObjectTransactionprovides methods to read and write data within a transaction.See
Firestore.runTransaction(_:)Declaration
Objective-C
@interfaceFIRTransaction:NSObjectOptions to customize the behavior of
Firestore.runTransactionWithOptions().Declaration
Objective-C
@interfaceFIRTransactionOptions:NSObject<NSCopying>A write batch is used to perform multiple writes as a single atomic unit.
A WriteBatch object can be acquired by calling
Firestore.batch(). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) untilWriteBatch.commit()is called.Unlike transactions, write batches are persisted offline and therefore are preferable when you don’t need to condition your writes on read data.
Declaration
Objective-C
@interfaceFIRWriteBatch:NSObject
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 2025-03-11 UTC.