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

77
Vistas
How to store product addons in Firestore DB?

So, I have a product saved to my Firestore DB, but I havent figure out how I can manage product addons, for example lets say the item was a pizza, and the person wanted extra cheese or extra tomatoes. Im not sure the best way to map this info in my DB. Lets say the following is my product entry (removed things like added timestamps for simplicities sake)

{
   itemName (String)
   itemBasePrice (number)
   itemStock (number)
   availableAt (array (of stores))
}

What is the best way for me to map product addons like extra cheese, or pepperoni, etc. should I make a DB entry for each addon? I feel like its expensive to make 100 calls from the DB to add one item to your basket?

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

0

Based on the description you provided, I think for this use case, nested fields or arrays should be the best option. I suggest you refer to this documentation and blog on how to structure data and use of arrays. If there is more information that needs to be tracked for each add ons, then you can consider using sub-collections. There are pros and cons for each way to structure the data. It really depends on how you are planning to use/query the data.

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