createSubDocument method
Add a subdocument to a specific document in a collection.
collectionPath
- The path of the parent collection.
docId
- The ID of the parent document.
subCollection
- The name of the subcollection within the parent document.
data
- A map containing the data for the subdocument.
Implementation
Future<void> createSubDocument(
String collectionPath, String docId, String subCollection, Map<String, dynamic> data) async {
await _db.collection(collectionPath).doc(docId).collection(subCollection).add(data);
}