Why I'm getting a different result from firestore using AngularFire

Viewed 38

I have 2 documents in my collection, the expected result is to get an array of 2 different values, but every time I get an array of 3 or 5 values which some of them are duplicated.

this is my code :

getAllDrops(date: string) {
    this.campaignService.getAllCampaigns().subscribe((res) => {
      res.forEach((campaign) => {
        campaign.drops.forEach((drop) => {
          if (drop.dropDate === date) {
            this.dropsVolumeArray.push(drop.dropVolume);
          }
        });
      });
    });

the result when I print dropsVolumeArray in the console :

enter image description here

I want to get dropVolume for every document in the collection, (Drops is a nested list in the collection)

Any help ?

0 Answers
Related