deleteSubCollectionDocument method
Future<bool>
deleteSubCollectionDocument(
{ - required String collection,
- required String documentId,
- required String subCollection,
- required String subCollectionDocumentId,
})
Implementation
Future<bool> deleteSubCollectionDocument({
required String collection,
required String documentId,
required String subCollection,
required String subCollectionDocumentId,
}) async {
try {
_loggingService.log('FirestoreGenericService.deleteDocument: Deleting. Collection $collection, DocId: $documentId'
' SubCollection $subCollection, SubCollectionDocId: $subCollectionDocumentId');
await _firebaseFirestore
.collection(collection)
.doc(documentId)
.collection(subCollection)
.doc(subCollectionDocumentId)
.delete();
_loggingService.log('FirestoreGenericService.deleteDocument: Deleted. Collection $collection, DocId: $documentId');
return true;
} catch (e) {
_loggingService.log(
'FirestoreGenericService.deleteDocument: Exception: $e',
logType: LogType.error,
);
return false;
}
}