Firebase – Firestore: Create a document if one does not exist
Im writing an app in flutter, and im trying to make a messages document that stores a list of messages using the following: Future<void> updateStingrayMessageForLike( String chatId, String? stingrayid) async { return FirebaseFirestore.instance .collection('stingrays') .doc(stingrayid) .collection('messages') .doc(chatId) .set({'messages': []}, SetOptions(merge:…