Hello All,
I know that fire base creates a UUID for each document created but they are random, I want to create a custom incremental UserID whenever a new user has signed up, I have tried creating an document where i can just increment a field and generate a Id based on the counter Value,
But the proble with this method is it involves a read operation(current count value) a write( increment to the count) and then creating a id and writing it in the document, that is 3 operations for one Id, it would become expensive as the app scales up
then I tried creating a custom cloud function which would be called at the moment of user sign up the cloud function will return the user id(string), code mentioned below
now will the Counter value increment with each call or will it just start from one again(does it create multiple instances in the time of concurrency) , and does the value ever get reset if the function is not invoked for a long time
this might be silly question but for a someone with no coding background reading the firebase documentation doesn't workπ
and as a First-time developer i'm scared because of the 3 operations as i somehow got 92k reads with no users at allπ¬