firebase::firestore

Cloud Firestore API.

Summary

Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud Platform.

Enumerations

AggregateSource{
  kServer
}
enum
The sources from which AggregateQuery::Get can retrieve its results.
Error{
  kErrorOk = 0,
  kErrorCancelled = 1,
  kErrorUnknown = 2,
  kErrorInvalidArgument = 3,
  kErrorDeadlineExceeded = 4,
  kErrorNotFound = 5,
  kErrorAlreadyExists = 6,
  kErrorPermissionDenied = 7,
  kErrorResourceExhausted = 8,
  kErrorFailedPrecondition = 9,
  kErrorAborted = 10,
  kErrorOutOfRange = 11,
  kErrorUnimplemented = 12,
  kErrorInternal = 13,
  kErrorUnavailable = 14,
  kErrorDataLoss = 15,
  kErrorUnauthenticated = 16
}
enum
Error codes used by Cloud Firestore.
MetadataChanges{
  kExclude,
  kInclude
}
enum
Indicates whether metadata-only changes (that is, DocumentSnapshot::metadata() or QuerySnapshot::metadata() changed) should trigger snapshot events.
Source{
  kDefault,
  kServer,
  kCache
}
enum
Configures the behavior of DocumentReference::Get() and Query::Get().

Typedefs

MapFieldPathValue using
std::unordered_map< FieldPath, FieldValue >
A map of FieldValues indexed by field paths.
MapFieldValue using
std::unordered_map< std::string, FieldValue >
A map of FieldValues indexed by stringified field paths.

Functions

operator!=(const DocumentChange & lhs, const DocumentChange & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const GeoPoint & lhs, const GeoPoint & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const SnapshotMetadata & lhs, const SnapshotMetadata & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const AggregateQuery & lhs, const AggregateQuery & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const QuerySnapshot & lhs, const QuerySnapshot & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const Settings & lhs, const Settings & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const SetOptions & lhs, const SetOptions & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const FieldValue & lhs, const FieldValue & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const AggregateQuerySnapshot & lhs, const AggregateQuerySnapshot & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const DocumentReference & lhs, const DocumentReference & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const Filter & lhs, const Filter & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const LoadBundleTaskProgress & lhs, const LoadBundleTaskProgress & rhs)
bool
LoadBundleTaskProgress != comparison operator.
operator!=(const DocumentSnapshot & lhs, const DocumentSnapshot & rhs)
bool
Checks lhs and rhs for inequality.
operator!=(const TransactionOptions & lhs, const TransactionOptions & rhs)
bool
Compares two TransactionOptions objects for inequality.
operator!=(const Query & lhs, const Query & rhs)
bool
Checks lhs and rhs for inequality.
operator<(const GeoPoint & lhs, const GeoPoint & rhs)
bool
Checks whether lhs and rhs are in ascending order.
operator<=(const GeoPoint & lhs, const GeoPoint & rhs)
bool
Checks whether lhs and rhs are in non-descending order.
operator==(const DocumentChange & lhs, const DocumentChange & rhs)
bool
Checks lhs and rhs for equality.
operator==(const GeoPoint & lhs, const GeoPoint & rhs)
bool
Checks lhs and rhs for equality.
operator==(const SnapshotMetadata & lhs, const SnapshotMetadata & rhs)
bool
Checks lhs and rhs for equality.
operator==(const AggregateQuery & lhs, const AggregateQuery & rhs)
bool
Checks lhs and rhs for equality.
operator==(const QuerySnapshot & lhs, const QuerySnapshot & rhs)
bool
Checks lhs and rhs for equality.
operator==(const Settings & lhs, const Settings & rhs)
bool
Checks lhs and rhs for equality.
operator==(const SetOptions & lhs, const SetOptions & rhs)
bool
Checks lhs and rhs for equality.
operator==(const FieldValue & lhs, const FieldValue & rhs)
bool
Checks lhs and rhs for equality.
operator==(const AggregateQuerySnapshot & lhs, const AggregateQuerySnapshot & rhs)
bool
Checks lhs and rhs for equality.
operator==(const DocumentReference & lhs, const DocumentReference & rhs)
bool
Checks lhs and rhs for equality.
operator==(const Filter & lhs, const Filter & rhs)
bool
Checks lhs and rhs for equality.
operator==(const LoadBundleTaskProgress & lhs, const LoadBundleTaskProgress & rhs)
bool
LoadBundleTaskProgress == comparison operator.
operator==(const DocumentSnapshot & lhs, const DocumentSnapshot & rhs)
bool
Checks lhs and rhs for equality.
operator==(const TransactionOptions &, const TransactionOptions &)
bool
Compares two TransactionOptions objects for equality.
operator==(const Query & lhs, const Query & rhs)
bool
Checks lhs and rhs for equality.
operator>(const GeoPoint & lhs, const GeoPoint & rhs)
bool
Checks whether lhs and rhs are in descending order.
operator>=(const GeoPoint & lhs, const GeoPoint & rhs)
bool
Checks whether lhs and rhs are in non-ascending order.

Classes

firebase::firestore::AggregateQuery

A query that calculates aggregations over an underlying query.

firebase::firestore::AggregateQuerySnapshot

The results of executing an AggregateQuery.

firebase::firestore::CollectionReference

A CollectionReference can be used for adding documents, getting document references, and querying for documents (using the methods inherited from Query).

firebase::firestore::DocumentChange

A DocumentChange represents a change to the documents matching a query.

firebase::firestore::DocumentReference

A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location.

firebase::firestore::DocumentSnapshot

A DocumentSnapshot contains data read from a document in your Firestore database.

firebase::firestore::FieldPath

A FieldPath refers to a field in a document.

firebase::firestore::FieldValue

A field value represents variant datatypes as stored by Firestore.

firebase::firestore::Filter

A Filter represents a restriction on one or more field values and can be used to refine the results of a Query.

firebase::firestore::Firestore

Entry point for the Firebase Firestore C++ SDK.

firebase::firestore::GeoPoint

An immutable object representing a geographical point in Firestore.

firebase::firestore::ListenerRegistration

Represents a listener that can be removed by calling Remove().

firebase::firestore::LoadBundleTaskProgress

Represents a progress update or the final state from loading bundles.

firebase::firestore::Query

A Query which you can read or listen to.

firebase::firestore::QuerySnapshot

A QuerySnapshot contains zero or more DocumentSnapshot objects.

firebase::firestore::SetOptions

An options object that configures the behavior of Set() calls.

firebase::firestore::Settings

Settings used to configure a Firestore instance.

firebase::firestore::SnapshotMetadata

Metadata about a snapshot, describing the state of the snapshot.

firebase::firestore::Transaction

Transaction provides methods to read and write data within a transaction.

firebase::firestore::TransactionOptions

Options to customize transaction behavior for Firestore.runTransaction().

firebase::firestore::WriteBatch

A write batch is used to perform multiple writes as a single atomic unit.

Namespaces

firebase::firestore::csharp
firebase::firestore::model
firebase::firestore::util

Enumerations

AggregateSource

 AggregateSource

The sources from which AggregateQuery::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.

The AggregateQuery will fail if the server cannot be reached, such as if the client is offline.

Error

 Error

Error codes used by Cloud Firestore.

The codes are in sync across Firestore SDKs on various platforms.

Properties
kErrorAborted

The operation was aborted, typically due to a concurrency issue like transaction aborts, etc.

kErrorAlreadyExists

Some document that we attempted to create already exists.

kErrorCancelled

The operation was cancelled (typically by the caller).

kErrorDataLoss

Unrecoverable data loss or corruption.

kErrorDeadlineExceeded

Deadline expired before operation could complete.

For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire.

kErrorFailedPrecondition

Operation was rejected because the system is not in a state required for the operation's execution.

kErrorInternal

Internal errors.

Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken.

kErrorInvalidArgument

Client specified an invalid argument.

Note that this differs from FailedPrecondition. InvalidArgument indicates arguments that are problematic regardless of the state of the system (e.g., an invalid field name).

kErrorNotFound

Some requested document was not found.

kErrorOk

The operation completed successfully.

kErrorOutOfRange

Operation was attempted past the valid range.

kErrorPermissionDenied

The caller does not have permission to execute the specified operation.

kErrorResourceExhausted

Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.

kErrorUnauthenticated

The request does not have valid authentication credentials for the operation.

kErrorUnavailable

The service is currently unavailable.

This is a most likely a transient condition and may be corrected by retrying with a backoff.

kErrorUnimplemented

Operation is not implemented or not supported/enabled.

kErrorUnknown

Unknown error or an error from a different error domain.

MetadataChanges

 MetadataChanges

Indicates whether metadata-only changes (that is, DocumentSnapshot::metadata() or QuerySnapshot::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

 Source

Configures the behavior of DocumentReference::Get() and Query::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

Causes Firestore 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 the DocumentReference::Get() call will return an error and Query::Get() will return an empty QuerySnapshot with no documents.

kDefault

Causes Firestore 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

Causes Firestore 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 of FieldValues indexed by field paths.

MapFieldValue

std::unordered_map< std::string, FieldValue > MapFieldValue

A map of FieldValues indexed by stringified field paths.

Functions

operator!=

bool operator!=(
  const DocumentChange & lhs,
  const DocumentChange & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const GeoPoint & lhs,
  const GeoPoint & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const SnapshotMetadata & lhs,
  const SnapshotMetadata & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const AggregateQuery & lhs,
  const AggregateQuery & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const QuerySnapshot & lhs,
  const QuerySnapshot & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const Settings & lhs,
  const Settings & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const SetOptions & lhs,
  const SetOptions & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const FieldValue & lhs,
  const FieldValue & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const AggregateQuerySnapshot & lhs,
  const AggregateQuerySnapshot & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const DocumentReference & lhs,
  const DocumentReference & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const Filter & lhs,
  const Filter & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const LoadBundleTaskProgress & lhs,
  const LoadBundleTaskProgress & rhs
)

LoadBundleTaskProgress != comparison operator.

operator!=

bool operator!=(
  const DocumentSnapshot & lhs,
  const DocumentSnapshot & rhs
)

Checks lhs and rhs for inequality.

operator!=

bool operator!=(
  const TransactionOptions & lhs,
  const TransactionOptions & rhs
)

Compares two TransactionOptions objects for inequality.

operator!=

bool operator!=(
  const Query & lhs,
  const Query & rhs
)

Checks lhs and rhs for inequality.

operator<

bool operator<(
  const GeoPoint & lhs,
  const GeoPoint & rhs
)

Checks whether lhs and rhs are in ascending order.

operator<=

bool operator<=(
  const GeoPoint & lhs,
  const GeoPoint & rhs
)

Checks whether lhs and rhs are in non-descending order.

operator==

bool operator==(
  const DocumentChange & lhs,
  const DocumentChange & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const GeoPoint & lhs,
  const GeoPoint & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const SnapshotMetadata & lhs,
  const SnapshotMetadata & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const AggregateQuery & lhs,
  const AggregateQuery & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const QuerySnapshot & lhs,
  const QuerySnapshot & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const Settings & lhs,
  const Settings & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const SetOptions & lhs,
  const SetOptions & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const FieldValue & lhs,
  const FieldValue & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const AggregateQuerySnapshot & lhs,
  const AggregateQuerySnapshot & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const DocumentReference & lhs,
  const DocumentReference & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const Filter & lhs,
  const Filter & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const LoadBundleTaskProgress & lhs,
  const LoadBundleTaskProgress & rhs
)

LoadBundleTaskProgress == comparison operator.

operator==

bool operator==(
  const DocumentSnapshot & lhs,
  const DocumentSnapshot & rhs
)

Checks lhs and rhs for equality.

operator==

bool operator==(
  const TransactionOptions &,
  const TransactionOptions &
)

Compares two TransactionOptions objects for equality.

operator==

bool operator==(
  const Query & lhs,
  const Query & rhs
)

Checks lhs and rhs for equality.

operator>

bool operator>(
  const GeoPoint & lhs,
  const GeoPoint & rhs
)

Checks whether lhs and rhs are in descending order.

operator>=

bool operator>=(
  const GeoPoint & lhs,
  const GeoPoint & rhs
)

Checks whether lhs and rhs are in non-ascending order.