save id SetDocument in document #500
-
Is there a method to retrieve the id of the document I'm creating to save it within the data? const addDocument = async (image) => { |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
For example, you could first create an empty document, retrieve the ID and then update it. Or you could use the |
Beta Was this translation helpful? Give feedback.
-
Ok, great tips! I thought there was a way to recover it quickly. Thank you so much for the great work you do every day 💪💪💪 |
Beta Was this translation helpful? Give feedback.
-
If it helps, I solved it using a Firebase function. exports.addUidproblems = functions.firestore.document('problems/{problemId}') |
Beta Was this translation helpful? Give feedback.
For example, you could first create an empty document, retrieve the ID and then update it. Or you could use the
setDocument(...)
method and define a custom ID.