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

245
Views
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
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!