Finlay Percy
Finlay Percy

Reputation: 7169

is Firebase push().key length always 20 characters?

I am using Firebase to generate a unique key using .push().key Each instance I have seen is exactly 20 characters. Are they always 20 characters? As I plan on adding string length to my firebase rules.

Thanks

Upvotes: 2

Views: 2274

Answers (1)

Clinton
Clinton

Reputation: 973

When using push(), the generated keys have a fixed length of 20 characters. See this blog post for more information regarding the generation of the keys.

https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html

Upvotes: 6

Related Questions