Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Type Mapping

This page shows how MDL types correspond to Mendix internal types (BSON storage) and the Go SDK types used by modelsdk-go.

MDL to Backend Type Mapping

MDL TypeBSON $TypeGo SDK Type
StringDomainModels$StringAttributeType*StringAttributeType
String(n)DomainModels$StringAttributeType + Length*StringAttributeType{Length: n}
IntegerDomainModels$IntegerAttributeType*IntegerAttributeType
LongDomainModels$LongAttributeType*LongAttributeType
DecimalDomainModels$DecimalAttributeType*DecimalAttributeType
BooleanDomainModels$BooleanAttributeType*BooleanAttributeType
DateTimeDomainModels$DateTimeAttributeType*DateTimeAttributeType
DateDomainModels$DateTimeAttributeType*DateTimeAttributeType
AutoNumberDomainModels$AutoNumberAttributeType*AutoNumberAttributeType
BinaryDomainModels$BinaryAttributeType*BinaryAttributeType
EnumerationDomainModels$EnumerationAttributeType*EnumerationAttributeType
HashedStringDomainModels$HashedStringAttributeType*HashedStringAttributeType

Note that Date and DateTime both map to the same underlying BSON type. The distinction is handled at the UI layer.

Default Value Mapping

Default values are stored in BSON as StoredValue structures:

MDL DefaultBSON Structure
DEFAULT 'text'Value: {$Type: "DomainModels$StoredValue", DefaultValue: "text"}
DEFAULT 123Value: {$Type: "DomainModels$StoredValue", DefaultValue: "123"}
DEFAULT TRUEValue: {$Type: "DomainModels$StoredValue", DefaultValue: "true"}
(calculated)Value: {$Type: "DomainModels$CalculatedValue", Microflow: <id>}

All default values are serialized as strings in the BSON storage, regardless of the attribute type.

See Also