Is it possible when adding data manually to the Firebase database, through the dashboard, to let Firebase give each new object an unique key?
So for adding data, use only uniqueKeyRef reference. So, using this code you'll create a unique id only once. You'll be able to add those childs under a single id. If you want another key, see UUID which can help you generate unique keys for your Firebase database without having to use the push () method. Show activity on this post.
To solve this, the Firebase clients provide a push () function that generates a unique key for each new child. By using unique child keys, several clients can add children to the same location at the same time without worrying about write conflicts.
You can create a unique key in Firebase database using push () and then add child nodes under that key. Now next time when you come to that activity, first check if parent node exists or not. If the node exists, save parent node key and use it to save new child nodes. Now using the parentKey, you can add child node using that reference.
If you use password-based Firebase Authentication and someone gets hold of your API key, they will not be able to access any of your Firebase project's database or Cloud Storage data as long as this data is protected by Firebase Security Rules.
No, you cannot. To achieve this, you need to use the push()
method programmatically. This method will generate a unique key that can be saved in your database and used later in your project.
Please see official documentation regarding saving data into a Firebase database.
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With