newId()
Get a unique string-encoded 64-bit integer.
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 shouldn’t 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!