Not including fields vs storing fields with a null value

I have a schema which consists of a few attributes, Around 30 or so. The problem I am facing is that only two or three fields would be mandatory while the others would be optional.

I would like your help in understanding if it’s a good approach storing fields with null values instead of not storing them to the document at all.

Thanks for the help!

I prefer NOT storing the fields. Smaller space might make some operation faster.

It somewhat complicate the code since you have to process the absence of the field but in mi opinion it is not much more complicated than processing the null value.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.