Min Varchar Size
- Last Updated: July 30, 2025
- 1 minute read
- DataDirect Connectors
- ODBC
- MongoDB 8.0
- Documentation
Attribute
MinVarcharSize (mnvs)
Purpose
Specifies the minimum default length, in characters, of fields that are mapped as VARCHAR. The default length of VARCHAR columns is 1.5 times the largest data value the driver samples from the column. When the default length is less than the value specified for this option, the driver increases the default length to the value set for this option. Setting this option to a larger value than the calculated default allows for larger data values to be inserted by the driver.
Valid Values
x
where:
x
is the maximum size of the default length in characters given to columns that are mapped as VARCHAR.
Example
For example, Min Varchar Size is set to 1000, but the driver calculates a default length to be 500 based on the values sampled in your MongoDB STRING data column. Since the calculated value would be less than the setting of Min Varchar Size, the length is set to 1000. Conversely, in another column, the driver samples larger values and calculates a default length of 3000. Because the calculated value exceeds that of the Min Varchar Size option, the length would be set to 3000.
Notes
- The String Truncation Method For Writes (StringTruncationMethodForWrites) option determines the behavior of the driver when inserting String values that exceed the column length defined in the relational schema.
Default Value
1