I am trying to get the auto-generated ID from the DocumentReference Object
DocumentReference docref = db.collection("users").document();
String ID = check.getID();
The question is since the ID's are generated at client side there can be chances that 2 ID in firestore are similar to each other when their are more than a million document in a collection and when I use .set() the document gets updated. I have seen other answer but none solved my doubt.