getTypeInfo()
- Last Updated: March 30, 2020
- 2 minute read
- DataDirect Connectors
- JDBC
- MongoDB 6.0
- Documentation
The DatabaseMetaData.getTypeInfo() method returns information about data types. The following table provides getTypeInfo() results for supported MongoDB data types.
|
TYPE_NAME = ARRAY 1
|
|
|
TYPE_NAME = BIGINT
|
|
|
TYPE_NAME = BINDATA
|
|
|
TYPE_NAME = BOOLEAN
|
|
|
TYPE_NAME = DATE
|
|
|
TYPE_NAME = DECIMAL128
|
|
|
TYPE_NAME = DOUBLE
|
|
|
TYPE_NAME =INTEGER
|
|
|
TYPE_NAME =OBJECT 3
|
|
|
TYPE_NAME = OBJECTID4
|
|
|
TYPE_NAME = STRING |
|
1 Complex data types can be
returned as strings in the JSON format, or can be normalized
such that nested elements are returned as columns in a
relational table.
2 The driver
reports a precision of 68 digits for this type; however,
the native type limits the maximum number of digits
before or after the decimal to 34 digits.
3 Complex data types can be
returned as strings in the JSON format, or can be normalized
such that nested elements are returned as columns in a new
logical table.
4 The CAST_TO_NATIVE function escape may be
needed to select or insert a value of the ObjectID type when
MongoDB has inconsistent native types for a given field. See
"Default Mapping of Columns with Inconsistent Native Data
Types" and "CAST_TO_NATIVE Function Escape" for
details.
5 When the driver
discovers a column with a String size less than or equal
to 4000 characters, String is mapped as VARCHAR and the
precision is 4000 characters. When a column with a
String size greater than 4000 characters is discovered,
String is mapped as LONGVARCHAR and precision is 16
MB.
6 During the initial
discovery and normalization process, you can use the
DefaultVarcharSize configuration option to specify the
default length of fields that are discovered and mapped
as Varchar by the driver. If the driver discovers a
field with String data of a greater length, the String
data is truncated to the length of the specified value.
See "DefaultVarcharSize (Configuration Option" for
details.
7 You can map String to
CHAR, VARCHAR, or LONGVARCHAR, regardless of the column
size, using the Schema Tool. See "Creating and
Customizing Schemas Using the DataDirect Schema Tool"
and "Defining Columns" for details.