facet classafMorphia::BsonProp
sys::Obj afMorphia::BsonProp : sys::Facet
Marks a field as a property of a BSON object.
- defVal
const Obj? defVal
When converting to BSON, any Fantom value that equals this
defVal
will be treated as if it werenull
and (depending onObjConverter
) will not exist in the BSON object.When converting from BSON, any
null
value will be converted to thisdefVal
.This is most useful for saving marker booleans and to avoid saving empty lists and maps.
- implType
const Type? implType
The implementation
Type
to be instantiated should this field reference a mixin or a superclass. Used when mapping from BSON objects to Fantom objects.For dynamic typing evaluated at runtime, use a field named
_type
:@BsonProp Type _type := this.typeof
Defaults to the field type.
- name
const Str? name
Name of the BSON property name this field maps to.
Defaults to the field name.