jonasrichard/ejson

Define default value for field

jonasrichard opened this issue · 1 comments

Sometimes JSON doesn't have an attribute, but in the record definition there are some fields which are needed. It can happen when a record got new fields during application upgrade, but the old values don't contain those fields in the database.

-json(author, {string, "name"}, {"numberOfBooks", 0}).

Let us note that strings, binaries, boolean and numeric fields can have default value. Default value can be anything, a tuple or a record as well.

Not in this form but it is completed (field option list).