Default inputs for an Empty items in the database collection

There are 2 ways of doing that: At writing time or at reading time.

  1. Writing time : use a beforeUpdate/beforeInsert hook to set default value for missing property.

  2. Reading time: once the dataset is loaded, set a default value for the property without value.

Option 1 one required less work overall but option 2 is better because the collection will not hold virtual pre-made values (user might update the value later and does not want to have the field pre-filled with a default value).