FirebaseFirestore Framework Reference

Classes

The following classes are available globally.

  • Represents an aggregation that can be performed by Firestore.

    Declaration

    Objective-C

    @interfaceFIRAggregateField:NSObject
  • A query that calculates aggregations over an underlying query.

    Declaration

    Objective-C

    @interfaceFIRAggregateQuery:NSObject
  • The results of executing anAggregateQuery.

    Declaration

    Objective-C

    @interfaceFIRAggregateQuerySnapshot:NSObject
  • ACollectionReference object can be used for adding documents, getting document references,and querying for documents (using the methods inherited fromQuery).

    Declaration

    Objective-C

    @interfaceFIRCollectionReference:FIRQuery
  • ADocumentChange represents 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:NSObject
  • ADocumentReference refers 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. ADocumentReference can also be used to create aCollectionReference toa subcollection.

    Declaration

    Objective-C

    @interfaceFIRDocumentReference:NSObject
  • ADocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with thedata property or by using subscript syntax to access a specific field.

    For aDocumentSnapshot that points to a non-existing document, any data access will returnnil. You can use theexists property to explicitly verify a documents existence.

    Declaration

    Objective-C

    @interfaceFIRDocumentSnapshot:NSObject
  • AQueryDocumentSnapshot contains 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 thedata property or by using subscript syntax to access a specific field.

    AQueryDocumentSnapshot offers the same API surface as aDocumentSnapshot. As deleted documents are not returned from queries, itsexists property will always be true anddata() will never returnnil.

    Declaration

    Objective-C

    @interfaceFIRQueryDocumentSnapshot:FIRDocumentSnapshot
  • AFieldPath refers 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 withsetData() orupdateData().

    Declaration

    Objective-C

    @interfaceFIRFieldValue:NSObject
  • A Filter represents a restriction on one or more field values and can be used to refinethe results of a Query.

    Declaration

    Objective-C

    @interfaceFIRFilter:NSObject
  • Firestore represents a Firestore Database and is the entry point for all Firestoreoperations.

    Declaration

    Objective-C

    @interfaceFIRFirestore:NSObject
  • Settings used to configure aFirestore instance.

    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:NSObject
  • Represents 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:NSObject
  • Configures 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 toFirestoreSettings.cacheSettings, and useFirestoreSettings instance 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 initializeMemoryCacheSettings with 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 initializeMemoryCacheSettings with 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 toFirestoreSettings.cacheSettings, and useFirestoreSettings instance to configure Firestore SDK.

    Declaration

    Objective-C

    @interfaceFIRMemoryCacheSettings:NSObject<NSCopying,FIRLocalCacheSettings>
  • AQuery refers to a query which you can read or listen to. You can also constructrefinedQuery objects by adding filters and ordering.

    Declaration

    Objective-C

    @interfaceFIRQuery:NSObject
  • AQuerySnapshot contains zero or moreDocumentSnapshot objects. It can be enumeratedusing thedocuments property and its size can be inspected withisEmpty andcount.

    Declaration

    Objective-C

    @interfaceFIRQuerySnapshot:NSObject
  • Options to configure the behavior ofFirestore.addSnapshotListenerWithOptions(). Instancesof this class control settings like whether metadata-only changes trigger events and thepreferred data source.

    Declaration

    Objective-C

    @interfaceFIRSnapshotListenOptions:NSObject
  • Metadata about a snapshot, describing the state of the snapshot.

    Declaration

    Objective-C

    @interfaceFIRSnapshotMetadata:NSObject
  • Transaction provides methods to read and write data within a transaction.

    See

    Firestore.runTransaction(_:)

    Declaration

    Objective-C

    @interfaceFIRTransaction:NSObject
  • Options to customize the behavior ofFirestore.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 callingFirestore.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.