When i try add new data to firebase realtime database its converting my array to objects. Example:
"POINTS": [{
"w":237.00004067230424,
"x":0,
"y":0,
"h":8.996961455599944
},
{
"w":68.00003035736216,
"h":243.99697579886254,
"x":237,
"y":9
}]
in Realtime Database:
"POINTS":{
"0":{
"h":0.9969740288429421,
"w":96.00002364349457,
"x":0,
"y":0
},
"1":{
"h":163.99698397757402,
"w":41.000020286560755,
"x":97,
"y":1
}
}
how can i solve this problem? I want to get array like i tried to insert
My codes:
in firebase functions: my array is part of request body
exports.createDB = functions.https.onRequest((request, response) => {
response.header("Access-Control-Allow-Origin", "*");
const myRequest = request.body;
functions.logger.info(String(request.body));
database.ref("diagram/"+myRequest.user.uid).set(myRequest);
response.send(request.body);
});
I am sending the data using postman