is it possible to update this method:
void uploadMatch(team1, team2) {
Firestore.instance.collection("upcomings").add({
"createdAt": Timestamp.now(),
"upcomingTeam1": team1,
"upcomingTeam2": team2
});
}
so that if the upcomings collection doesn't exist, it creates it? Thanks!
From the documentation:
Collections and documents are created implicitly in Cloud Firestore. Simply assign data to a document within a collection. If either the collection or document does not exist, Cloud Firestore creates it.
So to answer your question: It's not possible! The collection is created implicitly when you create a document and when you delete the last document in a collection, it will cease to exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With