Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
Iterar matriz para guardar datos en Firebase que no funciona Angular

Estoy tratando de guardar datos en firebase. Tengo una matriz de la que quiero guardar datos en firebase. Cuando el tamaño de la matriz es pequeño, funciona, pero cuando el tamaño es superior a 50, se atasca y no responde a nada.

He intentado algo como esto

 async handleOkCpy() { const modelId = this.cpyRadioValue; const mdlStgCopied = []; this.isCopying = true; let subscription; subscription = this.rcService.getSettingGroupData(this.cpyRadioValue).subscribe( async res => { const newAddedSetting = []; res.map(setting => { const index = this.settingGrpdata.findIndex(id => setting.id === id.id); if (index === -1) { newAddedSetting.push(setting); } }); console.log('Get data'); await Promise.all( newAddedSetting.map(async s => { console.log('Start'); await this.rcService.copySetting(this.settingId, s.id, s.typeId, s.data); console.log('Done'); }) ); console.log('here done'); // await this.copyModelDiagram(modelId); this.nzMessageService.success('Settings has been copied successfully!'); this.isCopying = false; // Unsubscribe observable to prevent infinite loopings subscription.unsubscribe(); }, err => { this.nzMessageService.error(err); } ); this.isVisibleCpySett = false; this.cpyRadioValue = ''; }

miservicio

 // copySetting copySetting(modelId, settGrpDocId, settingTypeId, settingData) { const serverTimeStamp = firebase.firestore.FieldValue.serverTimestamp(); const data = { typeId: settingTypeId, data: settingData, updatedAt: serverTimeStamp, settingId: settGrpDocId }; return this.afs .collection(`env/${currentENV.env}/baseModels`) .doc(modelId) .collection('settingsGroup') .doc(settGrpDocId) .set(data); }

De acuerdo con el código, el mensaje de inicio es igual a hecho, pero obtengo un "hecho" diferente cada vez que llamo a mi función.

No sé qué pasa aquí.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!