As push in firebase database generates random key I want it to be custom key like: may be starts with N1,N2,N3... instead of random keys to the child nodes(as shown in pic)database structure tree that my hardware is updating in cloud. I am new to JS so could someone help me formulate the snippet or code. I am able to deploy some github functions to firebase cloud but, I need help in writing appropriate code for my use case. I followed this link ( Setting custom key when pushing new data to firebase database ) but,what I understand there is each every child node with random key I have to separately set (rectify me if wrong) and it's not possible for many child nodes present so, can someone help write an appropriate code for my use case. I am complete beginer so please excuse me if I am asking too many questions for clarification.
Asked
Active
Viewed 295 times
0
-
1Consider formatting this question appropriately to improve readability. – Taslim Oseni Mar 21 '18 at 02:20
-
You should continue to use the firebase push keys - it guarantees unique keys. Whereas if you try and make a custom key like `N1`, `N2` then chances are you might duplicate a key if two users write data at the same time. – sketchthat Mar 21 '18 at 03:47
-
This is for testing alone right know I wanna know how I can do it so,if you could help me in that regard – Disha Karnataki Mar 21 '18 at 04:38