Formatting Firebase-response in to an Array

Viewed 43

I'm using Firebase Real-time Database.

The data structure looks like this:

Picture of (dummy) Database (should look like name --> timeStamp --> ListOfPeople)

And with my httpRequest (get(URL/name.json)) Request looks like this:

return this.http
      .get(
        'URLtoDatabase' +  this.loadedUser + '.json'
      ).pipe(tap(allC =>{
        this.allC = allC;
        console.log(this.allC)
    }));

And in an other component I'm Subscribing like this:

this.subscription = this.dataStorageService.getAllT().subscribe(
      (allV) => {
        this.allV = allV;
      }
    );

I get as response something like this:

{timeStamp: Array(11), timeStamp: Array(11), timeStamp: Array(11), timeStamp: Array(11), timeStamp: Array(11), …}

but I can't properly get/retrieve any value or array.

Unfortunatly I only get {undefined} as a response... and for response.name.timeStamp1 I get TypeError: Cannot read properties of undefined

Could please someone help?

0 Answers
Related