TurboFirestoreUpdateApi<T> extension

Extension that adds update operations to TurboFirestoreApi

Provides methods for updating existing documents in Firestore

Features:

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

Example:

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

See also: TurboFirestoreCreateApi document creation TurboFirestoreDeleteApi document deletion

on

Methods

updateDoc({required TurboWriteable writeable, required String id, WriteBatch? writeBatch, TurboTimestampType timestampType = TurboTimestampType.updatedAt, String? collectionPathOverride, Transaction? transaction}) Future<TurboResponse<DocumentReference<Object?>>>

Available on TurboFirestoreApi<T>, provided by the TurboFirestoreUpdateApi extension

Updates an existing document in Firestore
updateDocInBatch({required TurboWriteable writeable, required String id, WriteBatch? writeBatch, TurboTimestampType timestampType = TurboTimestampType.updatedAt, String? collectionPathOverride}) Future<TurboResponse<WriteBatchWithReference<Map<String, dynamic>>>>

Available on TurboFirestoreApi<T>, provided by the TurboFirestoreUpdateApi extension

Updates documents using a batch operation