'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?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source