Reputation: 1034
I'm working with a document and I want to create an empty collection inside the document.
FirebaseFirestore.instance.collection('Users').doc("thisdoc). ??? (create collection inside this document)
I don't know what to add instead of ???
Upvotes: 0
Views: 787
Reputation: 2096
The documentation will help you there.
NOTE The Firebase team is migrating these docs onto firebase.com directly, so this link may get old quickly in the next months.
EDIT. Since you need to create it under a subcollection, simply:
Pseudocode:
// WARN, PSEUDOCODE AHEAD
final documentRef = firestore.collection("myCol").document("myDoc");
final subCollectRef = documentRef.collection("mySubCol");
subCollectRef.add({
'your': 'data',
});
Upvotes: 2