Schema Definitions
To enable consistent support for your MongoDB data, you must configure the connector to use a schema definition from a JSON file
Note:
The Schema Editor is not supported on AIX. On all other platforms, information about how to use the Schema Editor can be found in the Schema Editor User Guide located in the installation directory of the connector.
- On Windows 7 or earlier, the guide is available from the SimbaMongoDB ODBC Driver program group in the Start menu.
- On Windows 8 or later, you can search for the guide on the Start screen.
When the connector connects to a database without a specified schema definition,
it automatically generates a temporary schema definitionSamplingStrategy
, SamplingLimit
, and SamplingStepSize
properties
Important:
When creating a schema definition or connecting to the database without specifying one, make sure to configure the connector to sample all the necessary data. Documents that are not sampled do not get included in the schema definition, and consequently do not become available in ODBC applications. If the schema definition was created through the Schema Editor, you can use the Schema Editor to sample additional documents and add them to the schema definition.
Mapping MongoDB Data
MongoDB is able to store data that follows different rules of data typing and structure compared to traditional relational data
The Simba MongoDB ODBC Connector does the following when generating a schema definition:
- Samples the data in the database in order to detect its structure and determine the data mappings that best support the data.
- Assigns a MongoDB data type to each column.
- Maps each MongoDB data type to the SQL data type that is best able to represent the greatest number of values.
- Renormalizes single-level objects into columns.
- For each array and nested object in the database, the connector generates a virtual table to expand the data, and saves these virtual tables as part of the schema definition. For more information about virtual tables, see Virtual Tables.
During this sampling process, the connector defines data types for each column, but does not change the data types of the individual cells in the database. As a result, columns may contain mixed data types. During read operations, values are converted to match the SQL data type of the column so that the connector can work with all the data in the column consistently.
- Virtual Tables
- Features
- Documents to Sample
- SamplingStrategy Method
- SamplingStep Size
- Configuring the Connector on page 1