Is there a way that I can get the auto-generated ID for a document created as part of a batch using Firestore?
When using .add()
I can easily get an ID:
When you call doc() without any arguments, it will immediately return a DocumentReference that has a unique id, without writing anything to the database - the id is generated on the client. So if you want that id, simply use the id property on that DocumentReference. That id will become visible in the database after you've written that document.