const mixinafMorphia::Converter

afMorphia::Converter

Implement to convert Fantom types to / from a MongoDB representation.

toFantom

Source

abstract Obj? toFantom(Type fantomType, Obj? mongoObj)

Converts a Mongo object to Fantom.

mongoObj is nullable so converters can create empty / default objects.

toMongo

Source

abstract Obj? toMongo(Obj fantomObj)

Converts a Fantom object to its Mongo representation.

Must return a valid BSON type (or a List or Map thereof).