Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

96
Vistas
Firestore update nested objects

I'm trying to add a message object in a nested map. As you can see in the screenshot below, I want to go in "us" then "0" then "messages" to add my object. enter image description here

I have used the following script :

firestore.collection("salon").document(idSalon).update( "us.0.messages",message );

When I use it, it just overwrites everything as you can see. enter image description here

Can someone help me, please?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As I see in your screenshot, the "us" field is of type array. To be able to update an array, you should use arrayUnion and not a simple field update. For that I recommend you check the official documentation regarding update elements in a Firestore array.

I have also written an article called:

  • How to update an array of objects in Firestore?

That I think it will help you understand this topic better.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda