VectorValue type support.FirebaseFirestoreSwift module
has been removed. See
https://firebase.google.com/docs/ios/swift-migration for migration
instructions.Timestamp class into FirebaseCore. FirebaseFirestore.Timestamp
was changed to FirebaseCore.Timestamp. (#13221)@DocumentID property wrapper's
setter no longer logs a warning since it discouraged valid patterns,
e.g., updating the document ID after the document is created in Firestore. (#12756)arrayRemove on Map object. (#12378)FirebaseFirestore module now contains Firebase Firestore's
Swift-only APIs that were previously only available via the
FirebaseFirestoreSwift extension SDK. See the
FirebaseFirestoreSwift release note from this release for more details.[added] Developers using Firestore on visionOS must use a source
Firestore distribution rather than the default binary distribution. To do
this, quit Xcode and open the desired project from the command line
with the FIREBASE_SOURCE_FIRESTORE environment variable:
open --env FIREBASE_SOURCE_FIRESTORE /path/to/project.xcodeproj
To go back to using the binary distribution of Firestore, quit Xcode and open Xcode like normal, without the environment variable. (#11492)
OR queries).Query.count(), which fetches the number of documents in the
result set without actually downloading the documents (#10246).@param comparator (#10226).FIRFirestore.setIndexConfigurationFromJSON and
FIRFirestore.setIndexConfigurationFromStream (#10090).ListenerRegistration::Remove() was
invoked concurrently (#10065).TransactionOptions to control how many times a transaction
will retry commits before failing (#9838).nil from the
update closure when running a transaction caused a crash in Swift by removing
the auto-generated async throwing method from the FirebaseFirestore
module. In order to use the async throwing transaction method, add the
FirebaseFirestoreSwift module dependency to your build target (#9426).local_serializer.cc about "implicit
conversion loses integer precision" that were introduced in 8.13.0 (#9430).[FIRTransaction getDocument] was called after
[FIRFirestore terminateWithCompletion] (#8760).DocumentSnapshot objects consider the document's key and data for
equality comparison, but ignore the internal state and internal version.FIRFirestore.loadBundle, FIRFirestore.loadBundleStream and
FIRFirestore.getQueryNamed. Bundles contain pre-packaged data produced
with the Server SDKs and can be used to populate Firestore's cache
without reading documents from the backend.FieldValue.arrayRemove() would only
delete the first occurrence of an element in an array in a latency
compensated snapshots.areTimestampsInSnapshotsEnabled
setting. Timestamp fields that read from a FIRDocumentSnapshot now always
return FIRTimestamp objects. Use FIRTimestamp.dateValue to convert to
NSDate if required.whereField(_:notIn:) and whereField(_:isNotEqualTo:) query
operators. whereField(_:notIn:) finds documents where a specified field’s
value is not in a specified array. whereField(_:isNotEqualTo:) finds
documents where a specified field's value does not equal the specified value.
Neither query operator will match documents where the specified field is not
present.limit() API may not always benefit,
depending on the accumulated changes.limit(toLast:) query operator, which returns the last
matching documents up to the given limit.gRPCCertificates-Cpp.bundle from your build. (#3951).Protobuf CocoaPod. If
you're manually tracking dependencies, you may be able to remove it from your
build (note, however, that other Firebase components may still require it).abseil CocoaPod. If you're manually
tracking dependencies, you need to add it to your build.whereField(_:in:) and whereField(_:arrayContainsAny:) query
operators. whereField(_:in:) finds documents where a specified field’s value
is IN a specified array. whereField(_:arrayContainsAny:) finds documents
where a specified field is an array and contains ANY element of a specified
array.addSnapshotsInSyncListener() method to
FIRFirestore that notifies you when all your snapshot listeners are
in sync with each other.waitForPendingWrites() method to FIRFirestore class
which allows users to wait on a promise that resolves when all pending
writes are acknowledged by the Firestore backend.terminate() method to FIRFirestore which terminates
the instance, releasing any held resources. Once it completes, you can
optionally call clearPersistence() to wipe persisted Firestore data
from disk.FieldValue.serverTimestamp() and an update with a
FieldValue.increment() were pending for the same document.oldIndex and newIndex values in DocumentChange to
actually be NSNotFound when documents are added or removed, respectively
(#3298).ABORTED.clearPersistence(), which clears the persistent storage
including pending writes and cached documents. This is intended to help
write reliable tests (https://github.com/firebase/firebase-js-sdk/issues/449).NSFileProtectionComplete. Note that Firestore does not support
operating in this mode--nearly all API calls will cause crashes while file
protection is enabled. This change just prevents a crash when Firestore is
idle (#2846).Firestore.collectionGroup() method.FieldValue.increment(), which can be used in
updateData(_:) and setData(_:merge:) to increment or decrement numeric
field values safely without transactions.areTimestampsInSnapshotsEnabled setting
is now enabled by default. Timestamp fields that read from a
FIRDocumentSnapshot will be returned as FIRTimestamp objects instead of
NSDate objects. Update any code that expects to receive an NSDate object.
See the reference
documentation
for more details.FIRTransaction.getDocument() has been changed
to return a non-nil FIRDocumentSnapshot with exists equal to false if
the document does not exist (instead of returning a nil
FIRDocumentSnapshot). Code that includes if (snapshot) { ... } must be
changed to if (snapshot.exists) { ... }.gRPCCertificates.bundle from the correct location.FIRFirestoreSettings.cacheSizeBytes. It must be set to a minimum of
1 MB. The garbage collection process can be disabled entirely by setting
FIRFirestoreSettings.cacheSizeBytes to kFIRFirestoreCacheSizeUnlimited.SnapshotMetadata.hasPendingWrites metadata flag.gRPC, gRPC-ProtoRPC, and
gRPC-RxLibrary frameworks have been replaced with gRPC-C++. While we
don't anticipate any issues, please report any issues with network
behavior you
experience. (#1968)get() call made after being offline
could incorrectly return cached data without attempting to reach the backend.get() to only make one attempt to reach the backend before
returning cached data, potentially reducing delays while offline.setData(..., merge:true).get(source:.Cache) could throw an
"unrecognized selector" error if the SDK has previously cached the
non-existence of the document (#1632).FieldValue.arrayUnion() and FieldValue.arrayRemove() to
atomically add and remove elements from an array field in a document.whereField(_:arrayContains:) query filter to find
documents where an array field contains a specific element.setData methods taking mergeFields: arguments can now delete
fields using FieldValue.delete().FirestoreSettings would accept a concurrent
dispatch queue, but this configuration would trigger an assertion failure.
Passing a concurrent dispatch queue should now work correctly (#988).DocumentListenOptions object with a simple boolean.
Instead of calling
addSnapshotListener(options: DocumentListenOptions.includeMetadataChanges(true))
call addSnapshotListener(includeMetadataChanges:true).QueryListenOptions object with simple booleans.
Instead of calling
addSnapshotListener(options:
QueryListenOptions.includeQueryMetadataChanges(true)
.includeDocumentMetadataChanges(true))
call addSnapshotListener(includeMetadataChanges:true).QuerySnapshot.documentChanges() is now a method which optionally
takes includeMetadataChanges:true. By default even when listening to a
query with includeMetadataChanges:true metadata-only document changes are
suppressed in documentChanges().SetOptions object with a simple boolean. Instead of
calling setData(["a": "b"], options: SetOptions.merge()) call
setData(["a": "b"], merge: true).SnapshotOptions object with direct use of the
FIRServerTimestampBehavior on DocumentSnapshot. Instead of calling
data(SnapshotOptions.serverTimestampBehavior(.estimate)) call
data(serverTimestampBehavior: .estimate). Changed get similarly.mergeFields:(NSArray<id>*) override for set()
which allows merging of a reduced subset of fields.getDocument() requests made while offline to be delayed by up to 10
seconds (rather than returning from cache immediately).Timestamp class to represent timestamp fields,
currently supporting up to microsecond precision. It can be passed to API
methods anywhere a system Date is currently accepted. To make
DocumentSnapshots read timestamp fields back as Timestamps instead of
Dates, you can set the newly added property areTimestampsInSnapshotsEnabled
in FirestoreSettings to true. Note that the current behavior
(DocumentSnapshots returning system Dates) will be removed in a future
release. Using Timestamps avoids rounding errors (system Date is stored as
a floating-point value, so the value read back from a DocumentSnapshot
might be slightly different from the value written).enableNetwork() that could
result in a "Mutation batchIDs must be acknowledged in order" assertion crash.disableNetwork() and enableNetwork() methods to
Firestore class, allowing for explicit network management.nil
instead of throwing an exception. A non-nullable QueryDocumentSnapshot is
introduced for Queries to reduce the number of nil-checks in your code.includeMetadataChanges option
enabled) now receive an event with snapshot.metadata.isFromCache set to
true if the SDK loses its connection to the backend. A new event with
snapshot.metadata.isFromCache set to false will be raised once the
connection is restored and the query is in sync with the backend again.closeWithFinaleState: that could be triggered by
signing out when the app didn't have a network connection.