Is there any chance to add a document to firestore collection with custom generated id, not the id generated by firestore engine?
To use a custom ID you need to use .set
, rather than .add
This creates a document with the ID "LA":
db.collection("cities").doc("LA").set({
name: "Los Angeles",
state: "CA",
country: "USA"
})
This is taken from the official docs here