Using Math.random() as a baseline to generate the document ID means that even with unlimited document ID possibilities, the randomly generated ID could end up being the same as an existing document. The better method is something like:
-Create Random ID for first doc
-All subsequent documents should be random +1 (or something similar).
Example:
Using Math.random() as a baseline to generate the document ID means that even with unlimited document ID possibilities, the randomly generated ID could end up being the same as an existing document. The better method is something like:
-Create Random ID for first doc -All subsequent documents should be random +1 (or something similar).