I want to set my document ids on the front end, at the same time I set the doc, so I was wondering if there is a way to generate Firestore IDs, which could look like this:
const theID = firebase.firestore().generateID() // something like this
firebase.firestore().collection('posts').doc(theID).set({
id: theID,
...otherData
})
I could use uuid or some other id generator package, but I'm looking for a Firestore id generator. This SO answer points to some newId method, but I can't find it in the JS SDK... (https://www.npmjs.com/package/firebase)