firebase:: firestore
CloudFirestore API.
Summary
CloudFirestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud Platform.
Enumerations | |
|---|---|
AggregateSource{ | enum The sources from whichAggregateQuery::Get can retrieve its results. |
Error{ | enum Error codes used by CloudFirestore. |
MetadataChanges{ | enum Indicates whether metadata-only changes (that is,DocumentSnapshot::metadata() orQuerySnapshot::metadata() changed) should trigger snapshot events. |
Source{ | enum Configures the behavior ofDocumentReference::Get() andQuery::Get(). |
Typedefs | |
|---|---|
MapFieldPathValue | usingstd::unordered_map<FieldPath,FieldValue >A map of FieldValues indexed by field paths. |
MapFieldValue | usingstd::unordered_map< std::string,FieldValue >A map of FieldValues indexed by stringified field paths. |
Functions | |
|---|---|
operator!=(constSnapshotMetadata & lhs, constSnapshotMetadata & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constGeoPoint & lhs, constGeoPoint & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constSettings & lhs, constSettings & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constQuerySnapshot & lhs, constQuerySnapshot & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constQuery & lhs, constQuery & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constAggregateQuerySnapshot & lhs, constAggregateQuerySnapshot & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constDocumentReference & lhs, constDocumentReference & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constFieldValue & lhs, constFieldValue & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constFilter & lhs, constFilter & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constDocumentChange & lhs, constDocumentChange & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constSetOptions & lhs, constSetOptions & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constLoadBundleTaskProgress & lhs, constLoadBundleTaskProgress & rhs) | boolLoadBundleTaskProgress != comparison operator. |
operator!=(constAggregateQuery & lhs, constAggregateQuery & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constDocumentSnapshot & lhs, constDocumentSnapshot & rhs) | boolChecks lhs andrhs for inequality. |
operator!=(constTransactionOptions & lhs, constTransactionOptions & rhs) | boolCompares two TransactionOptions objects for inequality. |
operator<(constGeoPoint & lhs, constGeoPoint & rhs) | boolChecks whether lhs andrhs are in ascending order. |
operator<=(constGeoPoint & lhs, constGeoPoint & rhs) | boolChecks whether lhs andrhs are in non-descending order. |
operator==(constSnapshotMetadata & lhs, constSnapshotMetadata & rhs) | boolChecks lhs andrhs for equality. |
operator==(constGeoPoint & lhs, constGeoPoint & rhs) | boolChecks lhs andrhs for equality. |
operator==(constSettings & lhs, constSettings & rhs) | boolChecks lhs andrhs for equality. |
operator==(constQuerySnapshot & lhs, constQuerySnapshot & rhs) | boolChecks lhs andrhs for equality. |
operator==(constQuery & lhs, constQuery & rhs) | boolChecks lhs andrhs for equality. |
operator==(constAggregateQuerySnapshot & lhs, constAggregateQuerySnapshot & rhs) | boolChecks lhs andrhs for equality. |
operator==(constDocumentReference & lhs, constDocumentReference & rhs) | boolChecks lhs andrhs for equality. |
operator==(constFieldValue & lhs, constFieldValue & rhs) | boolChecks lhs andrhs for equality. |
operator==(constFilter & lhs, constFilter & rhs) | boolChecks lhs andrhs for equality. |
operator==(constDocumentChange & lhs, constDocumentChange & rhs) | boolChecks lhs andrhs for equality. |
operator==(constSetOptions & lhs, constSetOptions & rhs) | boolChecks lhs andrhs for equality. |
operator==(constLoadBundleTaskProgress & lhs, constLoadBundleTaskProgress & rhs) | boolLoadBundleTaskProgress == comparison operator. |
operator==(constAggregateQuery & lhs, constAggregateQuery & rhs) | boolChecks lhs andrhs for equality. |
operator==(constDocumentSnapshot & lhs, constDocumentSnapshot & rhs) | boolChecks lhs andrhs for equality. |
operator==(constTransactionOptions &, constTransactionOptions &) | boolCompares two TransactionOptions objects for equality. |
operator>(constGeoPoint & lhs, constGeoPoint & rhs) | boolChecks whether lhs andrhs are in descending order. |
operator>=(constGeoPoint & lhs, constGeoPoint & rhs) | boolChecks whether lhs andrhs are in non-ascending order. |
Classes | |
|---|---|
| firebase:: | A query that calculates aggregations over an underlying query. |
| firebase:: | The results of executing anAggregateQuery. |
| firebase:: | ACollectionReference can be used for adding documents, getting document references, and querying for documents (using the methods inherited from |
| firebase:: | ADocumentChange represents a change to the documents matching a query. |
| firebase:: | ADocumentReference refers to a document location in aFirestore database and can be used to write, read, or listen to the location. |
| firebase:: | ADocumentSnapshot contains data read from a document in yourFirestore database. |
| firebase:: | AFieldPath refers to a field in a document. |
| firebase:: | A field value represents variant datatypes as stored byFirestore. |
| firebase:: | AFilter represents a restriction on one or more field values and can be used to refine the results of aQuery. |
| firebase:: | Entry point for the FirebaseFirestore C++ SDK. |
| firebase:: | An immutable object representing a geographical point inFirestore. |
| firebase:: | Represents a listener that can be removed by callingRemove(). |
| firebase:: | Represents a progress update or the final state from loading bundles. |
| firebase:: | AQuery which you can read or listen to. |
| firebase:: | AQuerySnapshot contains zero or moreDocumentSnapshot objects. |
| firebase:: | An options object that configures the behavior of Set() calls. |
| firebase:: | |
| firebase:: | Metadata about a snapshot, describing the state of the snapshot. |
| firebase:: | Transaction provides methods to read and write data within a transaction. |
| firebase:: | Options to customize transaction behavior for |
| firebase:: | A write batch is used to perform multiple writes as a single atomic unit. |
Namespaces | |
|---|---|
| firebase:: | |
| firebase:: | |
| firebase:: | |
Enumerations
AggregateSource
AggregateSourceThe sources from whichAggregateQuery::Get can retrieve its results.
| Properties | |
|---|---|
kServer | Perform the aggregation on the server and download the result. The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every request using this source necessarily involves a round trip to the server. TheAggregateQuery will fail if the server cannot be reached, such as if the client is offline. |
Error
ErrorError codes used by CloudFirestore.
The codes are in sync acrossFirestore SDKs on various platforms.
MetadataChanges
MetadataChangesIndicates whether metadata-only changes (that is,DocumentSnapshot::metadata() orQuerySnapshot::metadata() changed) should trigger snapshot events.
| Properties | |
|---|---|
kExclude | Snapshot events will not be triggered by metadata-only changes. |
kInclude | Snapshot events will be triggered by any changes, including metadata-only changes. |
Source
SourceConfigures the behavior ofDocumentReference::Get() andQuery::Get().
By providing a Source value, these methods can be configured to fetch results only from the server, only from the local cache, or attempt to fetch results from the server and fall back to the cache (which is the default).
| Properties | |
|---|---|
kCache | CausesFirestore to immediately return a value from the cache, ignoring the server completely (implying that the returned value may be stale with respect to the value on the server). If there is no data in the cache to satisfy theDocumentReference::Get() call will return an error andQuery::Get() will return an emptyQuerySnapshot with no documents. |
kDefault | CausesFirestore to try to retrieve an up-to-date (server-retrieved) snapshot, but fall back to returning cached data if the server can't be reached. |
kServer | CausesFirestore to avoid the cache, generating an error if the server cannot be reached. Note that the cache will still be updated if the server request succeeds. Also note that latency-compensation still takes effect, so any pending write operations will be visible in the returned data (merged into the server-provided data). |
Typedefs
MapFieldPathValue
std::unordered_map<FieldPath,FieldValue>MapFieldPathValue
A map ofFieldValues indexed by field paths.
MapFieldValue
std::unordered_map<std::string,FieldValue>MapFieldValue
A map ofFieldValues indexed by stringified field paths.
Functions
operator!=
booloperator!=(constSnapshotMetadata&lhs,constSnapshotMetadata&rhs)
Checkslhs andrhs for inequality.
operator!=
booloperator!=(constQuerySnapshot&lhs,constQuerySnapshot&rhs)
Checkslhs andrhs for inequality.
operator!=
booloperator!=(constAggregateQuerySnapshot&lhs,constAggregateQuerySnapshot&rhs)
Checkslhs andrhs for inequality.
operator!=
booloperator!=(constDocumentReference&lhs,constDocumentReference&rhs)
Checkslhs andrhs for inequality.
operator!=
booloperator!=(constDocumentChange&lhs,constDocumentChange&rhs)
Checkslhs andrhs for inequality.
operator!=
booloperator!=(constLoadBundleTaskProgress&lhs,constLoadBundleTaskProgress&rhs)
LoadBundleTaskProgress != comparison operator.
operator!=
booloperator!=(constAggregateQuery&lhs,constAggregateQuery&rhs)
Checkslhs andrhs for inequality.
operator!=
booloperator!=(constDocumentSnapshot&lhs,constDocumentSnapshot&rhs)
Checkslhs andrhs for inequality.
operator!=
booloperator!=(constTransactionOptions&lhs,constTransactionOptions&rhs)
Compares twoTransactionOptions objects for inequality.
operator<
booloperator<(constGeoPoint&lhs,constGeoPoint&rhs)
Checks whetherlhs andrhs are in ascending order.
operator<=
booloperator<=(constGeoPoint&lhs,constGeoPoint&rhs)
Checks whetherlhs andrhs are in non-descending order.
operator==
booloperator==(constSnapshotMetadata&lhs,constSnapshotMetadata&rhs)
Checkslhs andrhs for equality.
operator==
booloperator==(constQuerySnapshot&lhs,constQuerySnapshot&rhs)
Checkslhs andrhs for equality.
operator==
booloperator==(constAggregateQuerySnapshot&lhs,constAggregateQuerySnapshot&rhs)
Checkslhs andrhs for equality.
operator==
booloperator==(constDocumentReference&lhs,constDocumentReference&rhs)
Checkslhs andrhs for equality.
operator==
booloperator==(constDocumentChange&lhs,constDocumentChange&rhs)
Checkslhs andrhs for equality.
operator==
booloperator==(constLoadBundleTaskProgress&lhs,constLoadBundleTaskProgress&rhs)
LoadBundleTaskProgress == comparison operator.
operator==
booloperator==(constAggregateQuery&lhs,constAggregateQuery&rhs)
Checkslhs andrhs for equality.
operator==
booloperator==(constDocumentSnapshot&lhs,constDocumentSnapshot&rhs)
Checkslhs andrhs for equality.
operator==
booloperator==(constTransactionOptions&,constTransactionOptions&)
Compares twoTransactionOptions objects for equality.
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-11-18 UTC.