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???
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',
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.