When you call the . add method on a collection , a DocumentReference object is returned. DocumentReference has the id field, so you can get the id after the document was created.
When you call the . add method on a collection , a DocumentReference object is returned. DocumentReference has the id field, so you can get the id after the document was created.