TFirestoreUpdateApi<T> mixin

Extension that adds update operations to TFirestoreApi

Provides methods for updating existing documents in Firestore

Features:

  • Single document updates
  • Batch operations
  • Transaction support
  • Automatic timestamp management
  • Validation through TWriteable

Example:

final api = TurboFirestoreApi<User>();
final user = User(name: 'John Updated');
final response = await api.updateDoc(
  writeable: user,
  id: 'user-123',
);

See also: TFirestoreCreateApi document creation TFirestoreDeleteApi document deletion

Mixin applications

Properties

collection → CollectionReference<Object?>
The current collection
no setterinherited
doc → DocumentReference<Object?>
A new document
no setterinherited
genId String
Generates a new document ID without creating the document
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
writeBatch → WriteBatch
Helper method to fetch a WriteBatch from _firebaseFirestore..
no setterinherited

Methods

dispose() Future<void>
Releases resources held by this API instance.
inherited
docExists({required String id, String? collectionPathOverride}) Future<bool>
Used to determined if a document exists based on given id.
inherited
getDocRefById({required String id, String? collectionPathOverride}) → DocumentReference<Map<String, dynamic>>
Gets a document reference by ID for raw data access.
inherited
getDocRefByIdWithConverter({required String id, String? collectionPathOverride}) → DocumentReference<T>
Gets a document reference with type conversion.
inherited
listCollectionReference() → Query<Map<String, dynamic>>
Gets a collection reference for raw data access.
inherited
listCollectionReferenceWithConverter() → Query<T>
Gets a collection reference with type conversion.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runTransaction<E>(TransactionHandler<E> transactionHandler, {Duration timeout = const Duration(seconds: 30), int maxAttempts = 5}) Future<E>
Helper method to run a Transaction from _firebaseFirestore..
inherited
toString() String
A string representation of this object.
inherited
turboVars<V extends TApiVars>() → V
Returns a new instance of V with basic variables filled in.
inherited
updateDoc({required TWriteable writeable, required String id, WriteBatch? writeBatch, TTimestampType timestampType = TTimestampType.updatedAt, String? collectionPathOverride, Transaction? transaction}) Future<TurboResponse<DocumentReference<Object?>>>
Updates an existing document in Firestore
updateDocInBatch({required TWriteable writeable, required String id, WriteBatch? writeBatch, TTimestampType timestampType = TTimestampType.updatedAt, String? collectionPathOverride}) Future<TurboResponse<TWriteBatchWithReference<Map<String, dynamic>>>>
Updates documents using a batch operation

Operators

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