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

168
Views
Firestore, agregando valor a un campo de matriz existente

Quiero que se agregue el nuevo valor de ph en la lista de matrices, pero en su lugar, sigue actualizando el primer valor de la lista de matrices

mi tienda de fuego

 var insBtn = document.getElementById("InsBtn"); async function AddDocument_CustomID() { var ref = doc(db,"pHvalue", "pH"); await setDoc( ref, { pH: [pH.value] }); } insBtn.addEventListener('click', AddDocument_CustomID);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si desea agregar un nuevo valor único a los valores existentes en la matriz de pH , puede usar una operación array-union :

 updateDoc(ref, { pH: arrayUnion(pH.value) });

Si, en cambio, desea agregar un valor posiblemente no único al final de la matriz de pH , deberá:

  1. Cargue el documento en su aplicación y obtenga la matriz de pH existente.
  2. Agregue el nuevo elemento al final de la matriz.
  3. Escriba toda la matriz de nuevo en la base de datos.
about 4 years ago · Juan Pablo Isaza Report
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!