I am looking to store a set of objects in Firebase using a single request with a unique key generated by Firebase (without using array indexes as keys).
let object_list = {
'0': {
'title':'title 1',
'time':'12.30pm',
},
'1': {
'title':'title 2',
'time':'12.30pm',
},
'2': {
'title':'title 3',
'time':'12.30pm',
},
}
this.agendaRef = firebase.database().ref('objs/');
let data = this.agendaRef.push();
data.set(object_list);
The expected output should be
-LioB1b06T7tfVhbJmss6o
time: "12.30pm"
title:"title 1"
-LioB1b06T7tfVhbsdfsdf
time: "12.30pm"
title:"title 2"
-LioB1b06Tsdsdsd7tfVh2
time: "12.30pm"
title: "title 3"
However, the actual output is
-LioB1b06T7tfVhbJm6o
0
time: "12.30pm"
title:"title 1"
1
time: "12.30pm"
title:"title 2"
2
time: "12.30pm"
title: "title 3"