newId()
Get a number that is unique across all databases.
Description
The newId()
method returns a number that is guaranteed to be unique across
all databases and is suitable for constructing the document ID part of a
document reference.
Document IDs are generated using the Twitter Snowflake algorithm. The IDs are
based on time instead of sequential numbers and are generally increasing.
The newId()
method should not be used to generate random numbers.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!