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

247
Vistas
best practice for nonexistent values in json object / mongodb object schema?

I am planning the schema for some objects to eventually be saved in a MongoDB collection. The objects I generate now are the output from a server app.

              "release-data": [
                {
                  "community": {
                    "have": 13,
                    "want": 8
                  },
                  "marketplace": {
                    "num_for_sale": null,
                    "lowest_price": null
                  },
                  "date": "2022-3-21 20:30:8"
                }
              ],
              "price-suggestions": [
                {
                  "prices": {},
                  "date": "2022-3-21 20:30:8"
                }
              ]

I am wondering if the best practice for the above fields which have no value would be null or empty object. Or maybe the marketplace field itself is assigned null or an empty object in this case?

I was considering a minimal approach where in this example the marketplace field in the release-data array would not exist and same thing with the prices field in the price-suggestions array not existing. But is that considered a bad practice since it is impossible to tell if the data is truly nonexistent or was omitted in error?

Is there anything else I may not be considering?

about 4 years ago · Juan Pablo Isaza
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