-
Type: New Feature
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Attributes, Persistence
-
(copied to CRM)
this allows us to define a field like field :local_default, type: Boolean, default: true, local_default: true, which then doesn't persist the "default" value when saving the document unless the the value is not the default. This helps cut down our document sizes when we still want sane defaults locally.
Note that this affects ETL: because ETL reads directly from Mongo, these defaults will no longer be available in that context, and will therefore be nil. For this reason you should be careful when using :local_default on fields, and ensure the ETL code is modified appropriately if a downstream client requires a field to have a default value.
- related to
-
MONGOID-4611 Option to unset nil-valued fields in DB
- Backlog
-
MONGOID-3653 Distinguish between nil and "unset" in DB (propose to introduce Mongoid::Undefined)
- Closed
- links to