I'm currently having a problem processing response data I've made to my firebase realtime database using REST in my Angular app. Just to preface: I'll be honest. I'm slowly learning both angular and firebase.
I have a child route in my database called "pending-orders"
https://i.sstatic.net/ytwEs.png
Each unique ID there matches the logged user that made the purchase order at the time.
To acquire all of my pending orders, I'm sending a GET http request to my database, the endpoint being pending-orders.json just as the firebase documentation suggests.
This gives me a response which, I assumed, was going to be an array. But instead is an object with nested objects. I logged the response, which is:
{G2v12VlKwNPXwtUDV4g41PIqHZx1: {…}, hYgflcf7WGR6wLrCPkAL1B4MbZI3: {…}}
What I need though is an array which contains the children (the values of the keys in that response object). I am not completely sure how to get one. How does one go about accomplishing this?
As an aside...
In fact, I am not even sure how I'd go about extracting a child node whose unique ID has been generated by firebase itself (through a POST request).
Unless I skipped something in the documentation for REST APIs, they cover how newly inserted child nodes get their own unique ID via POST requests, but later don't discuss how to access those child nodes particularly or via collections (like I'm trying to do). The client has no way of knowing those unique ids (or the custom ids I generated myself), as far as I'm concerned.