updateDocument method

Future<bool> updateDocument(
  1. String collection,
  2. String documentId,
  3. Map<String, dynamic> update
)

Implementation

Future<bool> updateDocument(String collection, String documentId, Map<String, dynamic> update) async {
  try {
    await _firebaseFirestore.collection(collection).doc(documentId).update(update);
    _loggingService.log('FirestoreGenericService.setDocument: Update. Collection $collection,'
        ' DocID: $documentId, Update: $update');
    return true;
  } catch (e) {
    _loggingService.log(
      'FirestoreGenericService.setDocument: Update failed. Update: $update, Exception: ${e.toString()}',
      logType: LogType.error,
    );
    return false;
  }
}