Reports
cannot be a document, it can only be a collection. So assuming you have a database structure that look like this:
Firestore-root
|
--- Reports (collection)
|
--- reportId (document)
|
--- // report details
To add a new collection under the reportId
document which in term contains other documents, please use the following line of code:
FirebaseFirestore rootRef = FirebaseFirestore.getInstance();
CollectionReference ref = rootRef
.collection("Reports").document(reportId)
.collection("NewCollection").document(newCollectionId);
ref.add(reports);
And your new sturcture will look like this:
Firestore-root
|
--- Reports (collection)
|
--- reportId (document)
|
--- // report details
|
--- NewCollection (collection)
|
--- newCollectionId (document)
|
---// newCollectionId details