I recently set up a firestore collection and successfully added data (documents) to it. Firestore conveniently generates unique document ids for each entry.
Inserting Data
this.afs.collection('questions').add({ 'question': message, 'asker': this.currentStudent, 'upvotes': this.upvote, 'lesson': this.currentLesson });
Now, I am eager to retrieve the document id of the newly inserted data and store it in a variable. Something along these lines:
this.documentId = newlyInsertedDocumentId
I recall hearing about using the document.Set() method for achieving this task. Can someone guide me on how to implement this?