How can I store data from an array to Firebase in a simple manner? Let's say I have an array of elements.
function Something() {
var elements=new Array()
elements[0]=10;
elements[1]=20;
elements[2]=30;
database = firebase.database();
var ref = database.ref('ExTable');
ref.set(elements);
}
Will the ref.set(elements); function successfully save the data to my Firebase DB?
The array currently contains three values. How do I go about storing them as nodes under a parent node, like this:
+---Parent
|
+---0
| |
| +---10
|
+---1
| |
| +---20
|
+---2
|
+---30
I'd like to organize the data in the above format because the array may contain varying numbers of elements at different times.