Include the document id as a field id in firestore
问题 Heres what i am trying to achieve i want a unique id field for every document in my database and i want that unique id to the same as the document id. Example: documents: data: eBgdTRE123 id:'eBgdTRE123' name:'Jhon Doe' job:'Programmer' i want i databse to have this structure, now i got two ideas to achieve this 1: to use cloud function and have onCreate listener and everytime theres a new document grab document and set the id field and update it heres how i am doing it exports