I have created a firestore collection and am able to add data(documents) to it, and firestore automatically generates its document id.
Adding data
this.afs.collection('questions').add({ 'question': message, 'asker': this.currentStudent, 'upvotes': this.upvote, 'lesson': this.currentLesson });
I would like to get the document id of this newly added document and assign it to a variable, something like:
this.documentId = newlyGeneratedDocumentsId
I read somewhere that I can do this using the document.Set() method, if so, how may I go about doing this?