facet classafMorphia::BsonProp
sys::Obj afMorphia::BsonProp : sys::Facet
Marks a field as a property of a BSON object.
- defVal
const Obj? defValWhen converting to BSON, any Fantom value that equals this
defValwill be treated as if it werenulland (depending onObjConverter) will not exist in the BSON object.When converting from BSON, any
nullvalue will be converted to thisdefVal.This is most useful for saving marker booleans and to avoid saving empty lists and maps.
- implType
const Type? implTypeThe implementation
Typeto be instantiated should this field reference a mixin or a superclass. Used when mapping from BSON objects to Fantom objects.Defaults to the field type.
Note that a property named
_typein the field's value overrides thisimplType.- name
const Str? nameName of the BSON property name this field maps to.
Defaults to the field name.
- pickleMode
const Bool pickleMode := falseTurns on Pickle Mode whereby all non
@Transientfields are converted, regardless of any@BsonPropfacets. Data from@BsonPropfacets, however, will still honoured if defined.