I am trying to add a new document in a firestore transaction with version 9 of the Firebase JS SDK. In version 8, we can use
const newDocRef = db.collection('coll').doc();
to get a DocumentReference to a document that does not exist yet, and then do a
transaction.set(newDocRef, { ... });
to set the document in a transaction.
How would we do the same in version 9? The new CollectionReference class does not seem have a doc()
method as in version 8.
Thanks!