Firestore class

Constructors

Firestore.new(FirebaseAdminApp app, {Settings? settings})

Properties

app FirebaseAdminApp
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collection(String collectionPath) CollectionReference<DocumentData>
Gets a CollectionReference instance that refers to the collection at the specified path.
collectionGroup(String collectionId) CollectionGroup<DocumentData>
Creates and returns a new Query that includes all documents in the database that are contained in a collection or subcollection with the given collectionId.
doc(String documentPath) DocumentReference<DocumentData>
Gets a DocumentReference instance that refers to the document at the specified path.
getAll<T>(List<DocumentReference<T>> documents, [ReadOptions? readOptions]) Future<List<DocumentSnapshot<T>>>
listCollections() Future<List<CollectionReference<DocumentData>>>
Fetches the root collections that are associated with this Firestore database.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runTransaction<T>(TransactionHandler<T> updateFuntion, {TransactionOptions? transactionOptions}) Future<T>
Executes the given updateFunction and commits the changes applied within the transaction. You can use the transaction object passed to 'updateFunction' to read and modify Firestore documents under lock. You have to perform all reads before before you perform any write. Transactions can be performed as read-only or read-write transactions. By default, transactions are executed in read-write mode. A read-write transaction obtains a pessimistic lock on all documents that are read during the transaction. These locks block other transactions, batched writes, and other non-transactional writes from changing that document. Any writes in a read-write transactions are committed once 'updateFunction' resolves, which also releases all locks. If a read-write transaction fails with contention, the transaction is retried up to five times. The updateFunction is invoked once for each attempt. Read-only transactions do not lock documents. They can be used to read documents at a consistent snapshot in time, which may be up to 60 seconds in the past. Read-only transactions are not retried. Transactions time out after 60 seconds if no documents are read. Transactions that are not committed within than 270 seconds are also aborted. Any remaining locks are released when a transaction times out.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited