updateSubCollectionsDocument method
Implementation
Future<bool> updateSubCollectionsDocument({
required String collection,
required String documentId,
required String subCollection,
required String subCollectionDocumentId,
required Map<String, dynamic> update,
}) async {
try {
await _firebaseFirestore
.collection(collection)
.doc(documentId)
.collection(subCollection)
.doc(subCollectionDocumentId)
.update(update);
_loggingService.log('FirestoreGenericService.setDocument: Update. Collection $collection, CollectionDocID: $documentId,'
' SubCollection: $subCollection, SubCollectionDocId: $subCollectionDocumentId, Update: $update');
return true;
} catch (e) {
_loggingService.log(
'FirestoreGenericService.setDocument: Update. Collection $collection, CollectionDocID: $documentId,'
' SubCollection: $subCollection, SubCollectionDocId: $subCollectionDocumentId,'
' Update: $update, Exception: ${e.toString()}',
logType: LogType.error,
);
return false;
}
}