I want to generate 6 digit unique number in Firbase (unique must)
above attendeeCode should be unique on every new attendess entry
I am new in firebase and I have searched alot but could not find
I want to generate 6 digit unique number in Firbase (unique must)
above attendeeCode should be unique on every new attendess entry
I am new in firebase and I have searched alot but could not find
Create a six digit number that corresponds to the nth entry into attendees
. And then keep track of that number elsewhere.
You can find in other questions that Firebase still does not support COUNT or LENGTH queries.
Create a path called /meta-data
(arbitrary) and save the number of current attendees:
meta-data: {
num_of_attendees: "000000" // parse this client side and send back padded string to keep 6 characters
}
Grab the value every time you add an attendee, increment it, and send it back. This keeps you from grabbing a list of all attendees and getting the length client-side.
A new option: Firebase Cloud Functions
This is still in beta, but is having fair success. They provided and example of this functionality here: