Q:

How To Store User Data In A Database With A Changing Unique Identifier

I'll make it quick. I'm building an application that will relay heavily on Firebase, and especially the Real Time Database. It functions purely off of user input, which can obviously change and mutate. Essentially they will be sending what I'm calling Bundles to the database. They contain vital information about location, information, etc. So, the question, how can I structure the add script from my application so I can make sure that no duplicate data bundle names are generated, as it wouldn't be ideal at all. Using a users UID also wouldn't be ideal as that could lead to an immediate duplicate data if they send two Bundles. Thanks everybody!

A:

I accomplished this by using the push function in the firebase documentation. This allows me to not only add the data bundle right into a list of other data bundles, but it also includes the server providing it with a unique key, thus removing all chances of duplicate bundle names occurring. You can check out the same docs by clicking here

