Does the MongoDB Driver support MongoDB 3.4?
Yes, current versions of the Simba MongoDB drivers support MongoDB 3.4.
My Simba MongoDB Driver can connect, but it seems to take quite a while
ODBC requires predefined schema in order to work. As a denormalized, schemaless data source, MongoDB data does not store this type of metadata and therefore the driver must inference it by reading a subset of the data. This process is called sampling.
Based on the size and complexity of your data, this sample time can take anywhere from a few seconds to a few minutes for large datasets.
The driver connection time can be improved by using a cached schema map, which can be created using the provided Schema Editor Tool. Using a schema map allows the driver to skip the sample step on connection, dramatically improving the connection time.
For detailed instructions, see the full documentation located here.
How do I define a schema for my connection?
To enable ODBC/JDBC applications to work with MongoDB data, the Simba MongoDB Driver maps MongoDB data types to SQL data types. The schema, which is called the “active metadata” when it is being used by the driver, determines how the driver maps the data types.
If the driver is connected without providing a target schema map, the driver will generate an in-memory schema map during the connection process. The drawback of this is that sampling needs to occur on each connection.
You can also manually define a schema and store it to the database to shared with other users or save it to a local JSON file for personal use. Using a manually defined schema map will skip the sample step, and can dramatically improve the overall sample time.
For detailed instructions, see the full documentation located here.
Does the driver support write-back?
Yes, it supports DML (INSERT, UPDATE, DELETE). The driver does NOT support CREATE, ALTER or DROP.
How are nested arrays represented via the MongoDB driver?
Please see the “Virtual Tables” section of the user guide.
How are nested documents represented via the MongoDB driver?
Nested documents are flattened and displayed as part of the parent document with a column name like parentName_childName.
I do not want the schema the driver uses to be held within MongoDB, what can I do?
The driver allows you to specify a local file to read the schema from, instead of reading from MongoDB. Note that a drawback to this approach is that the schema is only available to you, and if you publish a report using the local schema, then it may not work for other users unless they also possess the same schema file that you are using. Please see the user guide for more information.
If I only generate schema for certain collections in my database, will the other collections be visible to the driver?
No, if you create a schema file, only collections that are sampled and present in the schema file will be made visible by the driver.
I can't see one of my databases/tables/columns
The Simba MongoDB Driver relies on sampled data to use as metadata for ODBC/JDBC calls. This data is stored in a schema map which can either be generated and cached using the provided Schema Editor tool or is generated on-the-fly by the driver during connection. Since sampling the entire data set can take a long time for a large dataset, the driver attempts to inference the schema based on a subset or “sample” of the data. If a database, table or column appears missing, check your sampling settings and resample.
Sampling stops unexpectedly due to a Java Heap Space error when using 32-bit Schema Editor
The MongoDB ODBC Driver ships as either a 32-bit or a 64-bit program. The both versions of the driver sample the data in MongoDB database and map the MongoDB attributes to their equivalent SQL objects. This information is stored is stored in a schema map which is stored in the database or locally as a JSON file on the hard drive. Included with each driver is a standalone Java application called the Schema Editor. Schema Editor allows users to create, view and modify schema maps. The 32-bit version of the driver includes the 32-bit version of the Schema Editor and the 64-bit version of the driver includes the 64-bit version of the Schema Editor. As Schema Editor is a Java application, it uses the Java Virtual Machine (JVM) for execution. By default, the 32-bit JVM uses a lower maximum size of its memory allocation pool than that of the 64-bit JVM. The 32-bit SchemaEditor.exe uses 1024Mb as the max size and 256Mb as the initial size of the memory allocation pool. While this should be sufficient for most cases, for situations where the MongoDB documents have deeply-nested structures or a very large (thousands) of attributes the maximum memory allowed for the JVM may be exceeded. Should you encounter an issue where you encounter this in the form of a Java heap space error, you can launch Schema Editor by specifying larger initial and maximum values for the memory allocation pool as follows by using command line to open the SchemaEditor.jar located in the Tools folder of the install directory:
java -jar SchemaEditor.jar -Xmx2048m -Xms512m
The -Xmx flag specifies the maximum memory and -Xms specifies the initial amount of memory allocated.
The MongoDB ODBC Driver
I sometimes receive the following error: “Error creating temporary swap file name.”
In some cases, the driver must cache data from tables locally before it can create the final result set. This can occur when the driver needs to perform large, complex operations, such an ORDER BY, GROUP BY, DISTINCT or JOIN, on the client side. In these cases, the driver will use memory up to a certain threshold and then start spilling excess data over to disk. If there is a lot of data, then these “swap files” may become very large and the driver may run out of room on the local hard drive. Try to free up space on your hard drive and try again
If you are unable to free additional space on your main drive, you can specify an alternate location for the swap by doing the following:
- On Windows, open Regedit and navigate to HKLM\SOFTWARE\Simba\Simba MongoDB ODBC Driver\Driver (HKLM\SOFTWARE\Wow6432Node\Simba\Simba MongoDB ODBC Driver\Driver for a 32-bit driver on 64-bit Windows), and create a string value called SwapFilePath and enter a directory that the driver should create swap files in.
- On non-Windows platforms, open the .simba.mongodbodbc.ini file and create a SwapFilePath entry with a value equal to the driver the driver should create swap files in.
If I install the driver on Linux, are any extra libraries required?
Yes, you need a driver manager, such as unixODBC or iODBC. You also need the following libsasl libraries: cyrus-sasl-2.1.22-7 or later, cyrus-sasl-gssapi-2.1.22-7 or later, cyrus-sasl-plain-2.1.22-7 or later.