Add children using REST API in firebase
-
07-07-2021 - |
Pregunta
Hey I have a dataset uploaded in the following form:
SomeKey
-> Alphabet
-a: "['apple', 'ant']"
-b: "['ball', 'bat']"
Now using Rest API, I want to add new children to the object 'Alphabet'. Now if I use POST it inserts a new random key as a child to Alphabet and PUT at https://gamma.firebase.com/SomeKey overwrites the current data completely. How to insert a new child using the REST API?
Solución
You can address the children directly by URL.
If you wrote "a" and "b" originally to: /SomeKey/Alphabet
And then wanted to add "c" later, you can just send a PUT request to: /SomeKey/Alphabet/c
Additional details about the REST API are here: https://www.firebase.com/docs/rest-api.html
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow