28
Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide Version 1.5.16 July 15, 2014 Simba Technologies Inc.

Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

  • Upload
    others

  • View
    28

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector

for MongoDB

Installation and Configuration Guide

Version 1.5.16

July 15, 2014

Simba Technologies Inc.

Page 2: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.simba.com i

Copyright ©2012-2014 Simba Technologies Inc. All Rights Reserved.

Information in this document is subject to change without notice. Companies, names and data used in examples herein are fictitious unless otherwise noted. No part of this publication, or the software it describes, may be reproduced, transmitted, transcribed, stored in a retrieval system, decompiled, disassembled, reverse-engineered, or translated into any language in any form by any means for any purpose without the express written permission of Simba Technologies Inc.

Trademarks

Simba, the Simba logo, SimbaEngine, SimbaEngine C/S, SimbaExpress and SimbaLib are registered trademarks of Simba Technologies Inc. All other trademarks and/or servicemarks are the property of their respective owners.

ICU License - ICU 1.8.1 and later

COPYRIGHT AND PERMISSION NOTICE

Copyright (c) 1995-2010 International Business Machines Corporation and others

All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.

All trademarks and registered trademarks mentioned herein are the property of their respective owners.

OpenSSL

Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved.

Page 3: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.simba.com ii

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. All advertising materials mentioning features or use of this software must display the following acknowledgment:

"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/)"

4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact [email protected].

5. Products derived from this software may not be called "OpenSSL" nor may "OpenSSL" appear in their names without prior written permission of the OpenSSL Project.

6. Redistributions of any form whatsoever must retain the following acknowledgment:

"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)"

THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Expat

Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NOINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR

Page 4: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.simba.com iii

COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contact Us

Simba Technologies Inc. 938 West 8th Avenue Vancouver, BC Canada V5Z 1E5

www.simba.com

Telephone: +1 (604) 633-0008 Information and Product Sales: Extension 2 Technical Support: Extension 3

Fax: +1 (604) 633-0004

Information and Product Sales: [email protected] Technical Support: [email protected] Follow us on Twitter: @SimbaTech

Printed in Canada

Page 5: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.simba.com iv

Table of Contents Introduction ........................................................................................................................................................1

Windows Driver ..................................................................................................................................................1 System Requirements ................................................................................................................................1 Installing the Driver ...................................................................................................................................2 Creating a Data Source Name ................................................................................................................2 Configuring Options ...................................................................................................................................3 Defining the Schema .................................................................................................................................5

Linux Driver .........................................................................................................................................................7 System Requirements ................................................................................................................................7 Installation Using the RPM ......................................................................................................................7 Installation Using the Tarball Package ................................................................................................8 Setting the LD_LIBRARY_PATH Environment Variable ..................................................................9

Mac OS X Driver .................................................................................................................................................9 System Requirements ................................................................................................................................9 Installation .....................................................................................................................................................9

Configuring ODBC Connections for Linux and Mac OS X ............................................................... 10 Files ............................................................................................................................................................... 10 Sample Files ................................................................................................................................................ 11 Configuring the Environment .............................................................................................................. 11 Configuring the odbc.ini File ............................................................................................................... 12 Configuring the odbcinst.ini File ........................................................................................................ 13 Configuring the simba.mongodbodbc.ini File ................................................................................ 14

Features ............................................................................................................................................................. 14 SQL Connector ........................................................................................................................................... 14 Data Types ................................................................................................................................................... 14 Authentication .......................................................................................................................................... 17 Catalog Support ........................................................................................................................................ 17 Write-back .................................................................................................................................................. 17

Contact Us ........................................................................................................................................................ 19

Appendix: Advanced Driver Configuration Options .......................................................................... 20

Page 6: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 1

Introduction The Simba ODBC Driver with SQL Connector for MongoDB enables Business Intelligence (BI), analytics and reporting on data that is stored in MongoDB databases. The driver complies with the ODBC 3.52 data standard and adds important functionality such as Unicode, as well as 32- and 64-bit support for high-performance computing environments on all platforms.

ODBC is one of the most established and widely supported APIs for connecting to and working with databases. At the heart of the technology is the ODBC driver, which connects an application to the database. For more information about ODBC, see http://www.simba.com/odbc.htm. For complete information on the ODBC specification, see the ODBC API Reference at http://msdn.microsoft.com/en-us/library/windows/desktop/ms714562(v=vs.85).aspx

Simba ODBC Driver with SQL Connector for MongoDB is available for the Microsoft® Windows®, Linux and Mac OS X operating systems.

Note: For details on installing and setting up a MongoDB instance, see the Simba ODBC Driver with SQL Connector for MongoDB Quick Start Guide.

Windows Driver

System Requirements You install Simba ODBC Driver with SQL Connector for MongoDB on client computers accessing MongoDB databases. Each computer where you install the driver must meet the following minimum system requirements:

• One of the following operating systems (32- and 64-bit editions are supported):

o Windows® Vista

o Windows® 7 Professional

o Windows® 8

o Windows® 8.1

o Windows® Server 2008 R2

• 100 MB of available disk space

Important: To install the driver, you need Administrator privileges on the computer.

Simba ODBC Driver with SQL Connector for MongoDB Version 1.5 supports MongoDB 2.0.6 and newer.

Page 7: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 2

Installing the Driver On 64-bit Windows operating systems, you can execute 32- and 64-bit applications transparently. You must use the version of the driver matching the bitness of the client application accessing MongoDB databases:

• SimbaMongoDBODBC32.msi for 32-bit applications

• SimbaMongoDBODBC64.msi for 64-bit applications

You can install both versions of the driver on the same computer.

Note: For an explanation of how to use ODBC on 64-bit editions of Windows, see http://www.simba.com/docs/HOW-TO-32-bit-vs-64-bit-ODBC-Data-Source-Administrator.pdf

To install Simba ODBC Driver with SQL Connector for MongoDB:

1. Depending on the bitness of your client application, double-click to run SimbaMongoDBODBC32.msi or SimbaMongoDBODBC64.msi

2. Click Next

3. Select the check box to accept the terms of the License Agreement if you agree, and then click Next

4. To change the installation location, click the Change button, then browse to the desired folder, and then click OK. To accept the installation location, click Next

5. Click Install

6. When the installation completes, click Finish

7. If you received a license file via e-mail, then copy the license file into the \lib subfolder in the installation folder that you selected in step 4.

Creating a Data Source Name After installing Simba ODBC Driver with SQL Connector for MongoDB, you need to create a Data Source Name (DSN).

To create a Data Source Name:

1. On the Windows Start menu, click All Programs, then click the Simba MongoDB ODBC Driver 1.5 program group corresponding to the bitness of the client application accessing MongoDB databases, and then click ODBC Administrator

2. In the ODBC Administrator, click the Drivers tab, and then scroll down as needed to confirm that Simba MongoDB ODBC Driver appears in the alphabetical list of driver names.

3. To create a DSN on the computer that only the user currently logged into Windows can use, click the User DSN tab.

OR

Page 8: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 3

To create a DSN on the computer that all users who log into Windows can use, click the System DSN tab.

4. Click the Add button.

5. In the Create New Data Source dialog, select Simba MongoDB ODBC Driver, and then click Finish

6. In the Simba MongoDB ODBC Driver Setup dialog, type a name for the data source in the Data Source Name field.

7. In the Description field, type relevant details about the DSN.

8. In the Host field, type the name or IP address of the host where the MongoDB instance runs.

9. In the Port field, type the number of the port that the MongoDB instance uses.

10. In the Database field, type the name of the MongoDB database to which the client application needs to connect.

11. In the Username field, type the appropriate login credential for the DSN to provide when accessing the MongoDB database.

12. To configure advanced driver options, click the Advanced Options button. For details, see the section Configuring Options on page 3.

13. If you need to customize the schema that Simba ODBC Driver with SQL Connector for MongoDB detects for a MongoDB database, then click the Schema Definition button. For details, see the section Defining the Schema on page 5.

Note: To test the connection, click the Schema Definition button. If the connection is successful, then the Schema Definition dialog opens. If the connection is not successful, then an error dialog appears. To troubleshoot a connection, confirm that values and settings in the Simba MongoDB ODBC Driver Setup dialog are correct. Contact your MongoDB administrator for assistance as needed.

14. Click OK to close the Simba MongoDB ODBC Driver Setup dialog.

15. Click OK to close the ODBC Data Source Administrator dialog.

Configuring Options You can configure options using the following:

• Data Source Name

• Database connection string

For a list and description of advanced configuration settings available in Simba ODBC Driver with SQL Connector for MongoDB, see the Appendix: Advanced Driver Configuration Options on page 20.

Page 9: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 4

Using the Data Source Name

To set advanced options using the Simba MongoDB Driver Setup dialog:

1. In the ODBC Data Source Administrator where you created the DSN, select the DSN tab where the Data Source Name appears, and then select the Data Source Name.

2. Click the Configure button, and then click the Advanced Options button.

3. Select or clear the available check boxes, as needed:

• Use SQL_WVARCHAR for String data type

• Enable authentication

• Enable Metadata caching

• Omit default NULL columns on insert

• Truncate documents larger than 16MB

• Enable reading/writing as JSON document

• Validate BSON before writes

• Check GetLastError on writes

4. Type an appropriate value in the Rows Fetched Per Block field, as needed.

5. Type an appropriate value in the Nested Column Separator column, as needed.

6. Type an appropriate value in the Rows To Scan field, as needed.

7. Click the drop-down arrow next to the Read Preference field, and then select the appropriate option as needed.

8. In the String Column Lengths area, click the drop-down arrows next to the Standard, Container and DocumentAsJSON fields as needed, and then select appropriate values. You can also type values in the fields.

9. In the Update Configuration area, select or deselect the Enable Updating Multiple Rows check box, as needed.

10. In the Get Metadata From area, select Database or Local File. If you select Local File, then click the Browse button, then select the file from which to load metadata, and then click Open

11. In the Advanced Options dialog, click OK

12. In the Simba MongoDB ODBC Driver Setup dialog, click OK

Using a DSN-less Connection

Some applications provide support for connecting to a data source using a driver without a DSN.

Page 10: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 5

Here is an example of the minimum required attributes for a connection string without authentication:

Driver=Simba MongoDB ODBC Driver; Host=192.168.100.100; Port=27017; Database=MyDatabase

Here is an example of the minimum required attributes for a connection string with authentication:

Driver=Simba MongoDB ODBC Driver; Host=192.168.101.101; Port=27018; Database=MyDatabase; EnableAuthentication=1; UID=MyUsername; PWD=MyPassword

Here is an example connection string that sets some advanced options:

Driver=Simba MongoDB ODBC Driver; Host=192.168.100.100; Port=27017; Database=MyDatabase; UID=MyUsername; PWD=MyPassword; RowsFetchedPerBlock=4096; DefaultStringColumnLength=255; DefaultContainerColumnLength=511; DefaultJSONColumnLength=1023; UseSqlWVarchar=0; CacheMetadata=0

Defining the Schema Simba ODBC Driver with SQL Connector for MongoDB dynamically detects the database schema as needed in the process of connecting to a MongoDB database. You can also edit the schema that the driver uses to connect to the database manually.

To define manually the schema to use when Simba ODBC Driver with SQL Connector for MongoDB connects to the database:

1. In the ODBC Data Source Administrator where you created the DSN, select the DSN tab where the Data Source Name appears, and then select the Data Source Name.

2. Click the Configure button, and then click the Schema Definition button.

3. If authentication is enabled, then you are prompted to provide your login credentials. Type the database to which you want to connect, your user name and password, and then click OK

Page 11: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 6

4. In the Schema Definition dialog, click the drop-down arrow next to the Table Name field, and then select the table for which you want to edit the schema.

5. To filter sample data, type an appropriate JSON filter in the JSON Filter field, and then click the Resample button. In the confirmation dialog, click Yes

Note: The value you type in the JSON Filter field is the MongoDB equivalent of a WHERE clause in SQL. For example, the SQL statement SELECT * FROM at_1 WHERE _id = “T123” returns the row having the value T123 in the _id field from the table named at_1. In the Schema Definition dialog, selecting at_1 from the dropdown menu for the Table Name field, and then typing {_id: “T123”} in the JSON Filter field returns the same result.

Note: The value in the Rows to Scan field in the Advanced Options dialog determines the maximum number of rows in the table that the driver samples to detect columns and corresponding data types. Rows are sampled after any JSON filter is applied.

6. To edit columns defined in the schema:

a) To rename a column, select the column name, then click the column name, then type a new name for the column, and then press ENTER

b) To change the data type for a column, click the Type field for the column, and then click the appropriate data type.

c) To change the MongoDB data type for a column, click the Source Type field for the column, and then click the appropriate data type.

d) To show or hide an auto-detected column, click the Hide Column field for the column, and then click Show or Hide as needed.

e) Repeat steps a) to d) to edit more columns, as needed.

7. To add columns to the schema for the table:

a) Click the Add button. In the Columns area, a new entry named New column is created and selected.

b) Type a name for the column to add, and then press ENTER

c) In the Columns area, scroll as needed to view the column you created in step b), then click the Type field for the new column, and then click the appropriate data type.

d) Repeat steps a) to c) to add more columns, as needed.

8. To delete columns from the schema:

a) In the Columns area, select the name(s) of the column(s) to delete.

b) Click the Remove button.

9. Repeat steps 4 to 8 as needed to edit the schemas of other tables in the database.

Note: The Data Preview pane displays sample data from the table based on the currently defined schema.

Page 12: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 7

10. In the Options area, select whether to store the schema you defined manually in the database or in the file you specified in the Advanced Options dialog.

11. When you are finished defining the schema, click Save, and then click Yes when prompted to write metadata to the database.

OR

To discard changes, click the Cancel button, and then click OK when prompted to discard changes.

If you store schema data—metadata—in the database, then the metadata is stored in a collection called Mersenne_Collection_Metadata. As needed, you can copy the collection to other MongoDB instances to duplicate the schema definition.

Note: Deleting Mersenne_Collection_Metadata deletes the schema definition you defined.

Linux Driver

System Requirements Each computer where you install the driver must meet the following minimum system requirements:

• Red Hat® Enterprise Linux® (RHEL) 5.0, CentOS 5.0 or SUSE Linux Enterprise Server (SLES) 11 (32 and 64-bit editions are supported)

• 300 MB of available disk space

• An installed ODBC driver manager:

o iODBC 3.52.7 or above

OR

o unixODBC 2.2.12 or above

Simba ODBC Driver with SQL Connector for MongoDB Version 1.5 supports MongoDB 2.0.6 and newer.

Installation Using the RPM

You can install the driver using RPMs. There are two versions of the driver for Linux:

• SimbaMongoDBODBC-32bit-Version-Release.rpm—32-bit driver • SimbaMongoDBODBC-Version-Release.rpm—64-bit driver

The bitness of the driver that you select should match the bitness of the client application accessing your MongoDB-based data. For example, if the client application is 64-bit, then you should install the 64-bit driver. Note that 64-bit editions of Linux support both 32- and 64-bit

Page 13: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 8

applications. Verify the bitness of your intended application and install the appropriate version of the driver.

Simba ODBC Driver with SQL Connector for MongoDB driver files are installed in the following directories:

• /opt/simba/mongodbodbc/ErrorMessages—Error messages files directory

• /opt/simba/mongodbodbc/Setup—Sample configuration files directory

• /opt/simba/mongodbodbc/lib/32—32-bit shared libraries directory

• /opt/simba/mongodbodbc/lib/64—64-bit shared libraries directory

To install Simba ODBC Driver with SQL Connector for MongoDB:

1. In Red Hat Enterprise Linux 5.0 or CentOS 5.0, log in as the root user, then navigate to the folder containing the driver RPM packages to install, and then type the following at the command line, where RPMFileName is the file name of the RPM package containing the version of the driver that you want to install:

yum --nogpgcheck localinstall RPMFileName

OR

In SUSE Linux Enterprise Server 11, log in as the root user, then navigate to the folder containing the driver RPM packages to install, and then type the following at the command line, where RPMFileName is the file name of the RPM package containing the version of the driver that you want to install:

zypper install RPMFileName

2. If you received a license file via e-mail, then copy the license file into the /opt/simba/ mongodbodbc /lib/32 or /opt/simba/mongodbodbc /lib/64 folder, depending on the version of the driver that you installed.

Installation Using the Tarball Package

Alternately, the Simba ODBC Driver with SQL Connector for MongoDB is available for installation using a TAR.GZ tarball package. The tarball package includes:

• [INSTALL_DIR]/simba/mongodbodbc/ contains release notes, the Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide in PDF format and a Readme.txt file that provides plain text installation and configuration instructions.

• [INSTALL_DIR]/simba/mongodbodbc/lib/32 contains the 32-bit Simba MongoDB ODBC Driver for Linux, as well as the simba.mongodbodbc.ini configuration file.

• [INSTALL_DIR]/simba/mongodbodbc/lib/64 contains the 64-bit Simba MongoDB ODBC Driver for Linux, as well as the simba.mongodbodbc.ini configuration file.

• [INSTALL_DIR]/simba/mongodbodbc/ErrorMessages contains error message files required by the Simba MongoDB ODBC Driver.

Page 14: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 9

• [INSTALL_DIR]/simba/mongodbodbc/Setup contains configuration files named odbc.ini and odbcinst.ini

Setting the LD_LIBRARY_PATH Environment Variable

The LD_LIBRARY_PATH environment variable must include the paths to installed ODBC driver manager libraries.

For example, if ODBC driver manager libraries are installed in /usr/local/lib, then set LD_LIBRARY_PATH as follows:

export LD_LIBRARY_PATH=/usr/local/lib

Refer to your Linux shell documentation for details on how to set environment variables permanently.

For details on creating ODBC connections using Simba ODBC Driver with SQL Connector for MongoDB, see Configuring ODBC Connections for Linux and Mac OS X on page 10.

Mac OS X Driver

System Requirements

Each computer where you install the driver must meet the following minimum system requirements:

• Mac OS X version 10.6.8 or later

• 100 MB of available disk space

• iODBC 3.52.7 or above

Simba ODBC Driver with SQL Connector for MongoDB Version 1.5 supports MongoDB 2.0.6 and newer.

Installation

Simba ODBC Driver with SQL Connector for MongoDB driver files are installed in the following directories:

• /opt/simba/mongodbodbc/ErrorMessages contains error message files required by the Simba ODBC Driver with SQL Connector for MongoDB.

• /opt/simba/mongodbodbc/Setup contains sample configuration files named odbc.ini and odbcinst.ini

• /opt/simba/mongodbodbc/lib/universal contains the Simba ODBC Driver with SQL Connector for MongoDB for Mac OS X, as well as the simba.mongodbodbc.ini configuration file.

Page 15: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 10

To install Simba ODBC Driver with SQL Connector for MongoDB:

1. Double-click to mount the SimbaMongoDBODBC.dmg disk image.

2. Double-click SimbaMongoDBODBC.pkg to run the Installer.

3. Follow the instructions in the Installer to complete the installation process.

4. When the installation completes, click Close

5. If you received a license file via e-mail, then copy the license file into the /opt/simba/mongodbodbc/lib/universal folder.

Setting the DYLD_LIBRARY_PATH Environment Variable

The DYLD_LIBRARY_PATH environment variable must include the paths to installed ODBC driver manager libraries.

For example, if ODBC driver manager libraries are installed in /usr/local/lib, then set DYLD_LIBRARY_PATH as follows:

export DYLD_LIBRARY_PATH=/usr/local/lib

Refer to your Mac OS X shell documentation for details on how to set environment variables permanently.

For details on creating ODBC connections using Simba ODBC Driver with SQL Connector for MongoDB, see Configuring ODBC Connections for Linux and Mac OS X on page 10.

Configuring ODBC Connections for Linux and Mac OS X

Files

ODBC driver managers use configuration files to define and configure ODBC data sources and drivers. By default, the following configuration files residing in the user’s home directory are used:

• .odbc.ini – The file used to define ODBC data sources (required)

• .odbcinst.ini – The file used to define ODBC drivers (optional)

Also, by default the Simba ODBC Driver with SQL Connector for MongoDB is configured using the simba.mongodbodbc.ini file in the subfolder in the /lib folder containing the binaries for the driver that you are using. The simba.mongodbodbc.ini file is required.

Note: The simba.mongodbodbc.ini file in the /lib subfolder provides default settings for most configuration options available in the Simba ODBC Driver with SQL Connector for MongoDB.

Page 16: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 11

Sample Files

The driver installation contains the following sample configuration files in the Setup directory:

• odbc.ini

• odbcinst.ini

The sample configuration files in the Setup directory provide preset values for settings related to the Simba ODBC Driver with SQL Connector for MongoDB.

The names of the sample configuration files do not begin with a period (.) in order to appear in directory listings by default. A filename beginning with a period (.) is hidden. For odbc.ini and odbcinst.ini, if the default location is used, then the filenames must begin with a period (.).

If configuration files do not exist in the user’s home directory, then you can copy the sample configuration files to the home directory, and then rename the files. If the configuration files already exist in the home directory, then use the sample configuration files as a guide to modify the existing configuration files.

Configuring the Environment

Optionally, you can use three environment variables—ODBCINI, ODBCSYSINI, and SIMBAMONGODBINI—to specify different locations for the odbc.ini, odbcinst.ini and simba.mongodbodbc.ini configuration files, respectively. Set ODBCINI to point to your odbc.ini file. Set ODBCSYSINI to point to the directory containing the odbcinst.ini file. Set SIMBAMONGODBINI to point to your simba.mongodbodbc.ini file. For example, if your odbc.ini and simba.mongodbodbc.ini files are located in the folder /etc and your odbcinst.ini file is located in the folder /usr/local/odbc, then set the environment variables as follows:

export ODBCINI=/etc/odbc.ini

export ODBCSYSINI=/usr/local/odbc

export SIMBAMONGODBINI=/etc/simba.mongodbodbc.ini

The following search order is used to locate the simba.mongodbodbc.ini file:

1. If the SIMBAMONGODBINI environment variable is defined, then the driver searches for the file specified by the environment variable.

Important: SIMBAMONGODBINI must contain the full path, including the filename.

2. The current working directory of the application is searched for a file named simba.mongodbodbc.ini (not beginning with a period).

3. The directory ~/ (that is, $HOME) is searched for a hidden file named .simba.mongodbodbc.ini

4. The directory /etc is searched for a file named simba.mongodbodbc.ini (not beginning with a period).

Page 17: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 12

Configuring the odbc.ini File Note: For an example odbc.ini file providing preset values for settings related to the Simba ODBC Driver with SQL Connector for MongoDB, see the Setup directory in the folder where you installed the driver.

ODBC Data Sources are defined in the odbc.ini configuration file. The file is divided into several sections:

• [ODBC] is optional and used to control global ODBC configuration, such as ODBC tracing.

• [ODBC Data Sources] is required, listing DSNs and associating DSNs with a driver.

• A section having the same name as the data source specified in the [ODBC Data Sources] section is required to configure the data source.

Here is an example odbc.ini configuration file for Linux:

[ODBC Data Sources]

Sample Simba MongoDB DSN 32=Simba MongoDB ODBC Driver 32-bit

[Sample Simba MongoDB DSN 32]

Driver=/opt/simba/mongodbodbc/lib/32/libsimbamongodbodbc32.so

HOST=MyMongoDBServer

PORT=10000

Here is an example odbc.ini configuration file for Mac OS X:

[ODBC Data Sources]

Sample Simba MongoDB DSN=Simba MongoDB ODBC Driver

[Sample Simba MongoDB DSN]

Driver=/opt/simba/mongodbodbc/lib/universal/libsimbamongodbodbc.dylib

HOST=MyMongoDBServer

PORT=10000

To create a data source:

1. Open the .odbc.ini configuration file in a text editor.

2. Add a new entry to the [ODBC Data Sources] section. Type the data source name (DSN) and the driver name.

3. To set configuration options, add a new section having a name matching the data source name (DSN) you specified in step 2. Specify configuration options as key-value pairs.

4. Save the .odbc.ini configuration file.

For details on configuration options available to control the behavior of DSNs using Simba ODBC Driver with SQL Connector for MongoDB, see Appendix: Advanced Driver Configuration Options on page 20.

Page 18: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 13

Configuring the odbcinst.ini File Note: For an example odbc.ini file providing preset values for settings related to the Simba ODBC Driver with SQL Connector for MongoDB, see the Setup directory in the folder where you installed the driver.

ODBC Drivers are defined in the odbcinst.ini configuration file. The configuration file is optional because drivers can be specified directly in the odbc.ini configuration file, as described in Configuring the odbc.ini File on page 12.

The odbcinst.ini file is divided into the following sections:

• [ODBC Drivers] lists the names of all the installed ODBC drivers.

• A section having the same name as the driver name specified in the [ODBC Drivers] section lists driver attributes and values.

Here is an example odbcinst.ini file for Linux:

[ODBC Drivers]

Simba MongoDB ODBC Driver 32-bit=Installed

Simba MongoDB ODBC Driver 64-bit=Installed

[Simba MongoDB ODBC Driver 32-bit]

Description=Simba MongoDB ODBC Driver (32-bit)

Driver=/opt/simba/mongodbodbc/lib/32/libsimbamongodbodbc32.so

[Simba MongoDB ODBC Driver 64-bit]

Description=Simba MongoDB ODBC Driver (64-bit)

Driver=/opt/simba/mongodbodbc/lib/64/libsimbamongodbodbc64.so

Here is an example odbcinst.ini file for Mac OS X:

[ODBC Drivers]

Simba MongoDB ODBC Driver=Installed

[Simba MongoDB ODBC Driver]

Description=Simba MongoDB ODBC Driver

Driver=/opt/simba/mongodbodbc/lib/universal/libsimbamongodbodbc.dylib

To define a driver:

1. Open the .odbcinst.ini configuration file in a text editor.

2. Add a new entry to the [ODBC Drivers] section. Type the driver name, and then type =Installed

Note: Assign the driver name as the value of the Driver attribute in the data source definition instead of the driver shared library name.

Page 19: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 14

3. In .odbcinst.ini, add a new section having a name matching the driver name you typed in step 2, and then add configuration options to the section based on the sample odbcinst.ini file provided with Simba ODBC Driver with SQL Connector for MongoDB in the Setup directory. Specify configuration options as key-value pairs.

4. Save the .odbcinst.ini configuration file.

Configuring the simba.mongodbodbc.ini File

To configure Simba ODBC Driver with SQL Connector for MongoDB to work with your ODBC driver manager:

1. Open the simba.mongodbodbc.ini configuration file in a text editor.

2. Edit the DriverManagerEncoding setting. The value usually must be UTF-16 or UTF-32, depending on the ODBC driver manager you use. iODBC uses UTF-32 and unixODBC uses UTF-16. Consult your ODBC Driver Manager documentation for the correct setting to use.

3. Edit the ODBCInstLib setting. The value is the name of the ODBCInst shared library for the ODBC driver manager you use. The configuration file defaults to the shared library for iODBC. In Linux, the shared library name for iODBC is libiodbcinst.so. In Mac OS X, the shared library name for iODBC is libiodbcinst.dylib.

Note: Consult your ODBC driver manager documentation for the correct library to specify. You can specify an absolute or relative filename for the library. If you intend to use the relative filename, then the path to the library must be included in the library path environment variable. In Linux, the library path environment variable is named LD_LIBRARY_PATH. In Mac OS X, the library path environment variable is named DYLD_LIBRARY_PATH.

4. Save the simba.mongodbodbc.ini configuration file.

Features

SQL Connector The SQL Connector feature of the driver allows applications to use normal SQL queries against MongoDB, translating standard SQL-92 queries into equivalent MongoDB API calls. This allows standard queries that BI tools execute to run against your MongoDB instance.

Data Types The following data types are supported:

• String

• Boolean

• NumberLong

• BinData

• Date

• jstOID

Page 20: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 15

• NumberInt

• NumberDouble

• Object (see below for more information)

• Array (see below for more information)

The following types are not yet supported:

• Code

• CodeWScope

• DBRef

• JSTypeMax

• MinKey

• MaxKey

• RegEx

• Symbol

• Timestamp

Embedded Documents

Embedded documents in MongoDB are represented as nested columns in the Simba ODBC Driver with SQL Connector for MongoDB. For example, consider the following JSON document:

{"contact": {"address": {"street": "1-123 Broadway", "city": "Vancouver"}}, "phone": "+12345678"}

The driver identifies the following columns in the document:

Column MongoDB Data Type Data

contact.address.street String 1-123 Broadway

contact.address.city String Vancouver

phone String +12345678

The identified columns will act in the same way as any other column when being mapped to SQL data types or when generalizing data types.

If there are different fields within a document, then only the most general fields are identified as columns. Consider the following two documents:

{"contact": {"address": {"street": "1-123 Broadway", "city": "Vancouver"}}, "phone": "+12345678"}

{"contact": {"address": "22 Cambie, Vancouver"}, "phone": "+87654321"}

In the second document, contact.address is not an embedded document so the driver considers contact.address as a String instead of an embedded document. Respectively, the driver identifies the following columns for each document:

Column MongoDB Data Type Data

contact.address String • {street: “1-123 Broadway”, city:

olivers
Rectangle
Page 21: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 16

“Vancouver”}

• 22 Cambie, Vancouver

phone String • +12345678

• +87654321

In a SQL query, when a column name contains the separator character you need to enclose the column name in quotes (“). For example:

SELECT "contact.address", "phone" FROM Contacts

Arrays

Arrays in MongoDB are also represented as nested columns in the Simba ODBC Driver with SQL Connector for MongoDB. Consider the following JSON document using an array:

{"values": ["hello", 1, {"v1": {"v2": "this is an embedded document"}}]}

The driver identifies the following columns:

Column MongoDB Data Type Data

values.0 String Hello

values.1 Double 1.0

values.2.v1.v2 String this is an embedded document

The column names include the index of the item in the array that the column represents, starting with an index of 0. In other words, the first element of the array uses a suffix of .0, the second element uses .1, and so on.

If different rows in the sample have the same field with different data types, then a precedence order is used to determine the type. The generated type will be the first one from the following list that appears in the sample data:

1. Array

2. Object

3. Binary

4. String

5. NumberDouble

6. NumberLong

7. NumberInt

Data types having no direct mapping from Mongo to ODBC are treated as data type String.

Columns mapped to SQL data types or generalized act in the same way as any other column.

olivers
Rectangle
olivers
Rectangle
Page 22: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 17

For example, the following field named f is generalized to type Array:

{f : {g1 : 1}}

{f : [1, 2, 3]}

In a SQL query, when a column name contains the separator character you need to enclose the column name in quotes (“). For example:

SELECT "values.0", "values.1", "values.2.v1.v2" FROM Contacts

Authentication Simba ODBC Driver with SQL Connector for MongoDB leverages authentication built into MongoDB. Built-in authentication requires users to supply a user name and password. If your MongoDB instance does not use authentication, then you can disable authentication for the DSN using the Simba MongoDB ODBC Driver Setup dialog.

For details on using authentication when installing the driver on the Windows operating system, see Creating a Data Source Name on page 2 and Configuring Options on page 3. For details on Linux and Mac OS X installations, see the section Configuring ODBC Connections for Linux and Mac OS X on page 10.

Catalog Support Simba ODBC Driver with SQL Connector for MongoDB supports catalogs by using the name of the MongoDB database as the catalog, allowing the driver to work easily with various ODBC applications.

Write-back Simba ODBC Driver with SQL Connector for MongoDB supports Data Manipulation Language (DML) statements such as INSERT, UPDATE and DELETE. These statements expose standard SQL-92 behavior. The driver does not execute the DML statements atomically, as MongoDB does not have transaction support. However, MongoDB guarantees atomic update on a single row and so does the driver. If an UPDATE/DELETE statement affects multiple rows and an error occurs in one of them, then the driver returns an error, but the rows that are already updated will remain so. Which means, for an UPDATE/DELETE statement, some rows may be updated successfully and the driver may return an error for the rest. Some special cases with DML statements are described in more detail below.

Page 23: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 18

INSERT

Each row in MongoDB needs to have a unique ID represented by the “_id” column. If not provided during insertion, MongoDB auto-generates a unique ID for each row. The “_id” field is exposed as a valid column in MongoDB ODBC Driver and can be auto-generated when issuing INSERT statements through the driver. For example, consider the following table:

_id sample_column

"517024D6CC79814E3FEBD352" 1

"5170ED77E49CC93A918DE316" 2

To insert a document with auto-generated value for “_id” (data type: jstOID), issue the following command:

INSERT INTO sample_table_1(sample_column) VALUES(3)

After the insertion, the table would look like as below:

_id sample_column

"517024D6CC79814E3FEBD352" 1

"5170ED77E49CC93A918DE316" 2

"51710FFCE49CC93A918DE322" 3

The value for the “_id” column can also be inserted using the INSERT statements, as in the following examples:

INSERT INTO sample_table_2(_id, sample_column) VALUES(1,1)

INSERT INTO sample_table_2 VALUES(1,1)

UPDATE

When updating rows, special care needs to be taken to avoid duplicate values for the “_id” column. As mentioned before, “_id” needs to be unique across all rows. When an UPDATE statement tries to set a value for the “_id” column and matches multiple rows, only one of the rows is updated with the new values, and the driver return an error for the remaining rows. UPDATE is not executed atomically.

DELETE

Currently, the driver considers a table valid as long as the table contains some data. If a table is completely empty, then the driver is not able to access the table. Consider the following example:

DELETE FROM sample_table_3

The command removes all data from sample_table_3. Therefore, sample_table_3 is invalid. Any users attempting to access the table receive an error.

Page 24: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 19

A table exists until the metadata is removed. Continuing the example, the following command removes the table metadata:

DROP TABLE sample_table_3

Supported Data Types for DML

Currently, Simba ODBC Driver with SQL Connector for MongoDB supports only the following data types in DML statements:

• String

• Boolean

• NumberLong

• NumberInt

• NumberDouble

• BinData

• Date

• Object

• Array

The driver does not yet support inserting/updating values for the jstOID (the ObjectId data type).

Also, the data provided in DML statements should match the existing column data types. For example, a String value cannot be inserted/set in a column having NumberInt data type.

Contact Us If you have difficulty using the driver, please contact our Technical Support staff. We welcome your questions, comments and feature requests.

Technical Support is available Monday to Friday from 8 a.m. to 5 p.m. Pacific Time.

Important: To help us assist you, prior to contacting Technical Support please prepare a detailed summary of the client and server environment including operating system version, patch level and configuration.

You can contact Technical Support via:

• E-mail: [email protected]

• Web site: www.simba.com

• Telephone: (604) 633-0008 Extension 3

• Fax: (604) 633-0004

You can also follow us on Twitter @SimbaTech

Page 25: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 20

Appendix: Advanced Driver Configuration Options You can configure options using the following:

• Data Source Name

• Database connection string

Table 1 lists advanced configuration settings available in Simba ODBC Driver with SQL Connector for MongoDB.

Field Label (Key)

Default Value

Description

Use SQL_WVARCHAR for String Data Type (UseSqlWVarchar)

Clear (0) When selected, the MongoDB String type is mapped to SQL_WVARCHAR instead of SQL_VARCHAR. The default value (0) causes the String type to be mapped to SQL_VARCHAR.

Enable Authentication (EnableAuthentication)

Clear (0) Enable user/password authentication during connection. The default value (0) disables authentication.

Enable Metadata Caching (CacheMetadata)

Selected (1) Simba ODBC Driver with SQL Connector for MongoDB dynamically detects the database schema as needed in the process of connecting to a MongoDB database. By default, the driver stores the metadata for reuse. When you disable metadata caching, the driver regenerates the metadata every time the driver accesses the database. If you disable metadata caching, then the driver continues to save schema definitions you set using the Schema Definition dialog. For details on using the Schema Definition dialog, see Defining the Schema on page 5. Important: Caching metadata is useful when defining the schema for your MongoDB database. After the schema is defined, disable metadata caching in your production environment.

Page 26: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 21

Field Label (Key)

Default Value

Description

Omit Default NULL Columns on Insert (OmitColumns)

Selected (1) This option affects the INSERT operations only. When selected (1), no null values (whether explicitly provided or not) are written to the columns of a table. When clear (0), explicitly provided null values are written to columns as specified, but no default null value is inserted.

Truncate Documents Larger Than 16MB (TruncateDocument)

Clear (0) When clear (0), the driver rejects any document that is greater than 16MB in size. When selected (1), the driver truncates any document that is greater than 16MB in size.

Enable Reading/Writing as JSON Document (UseJSONColumn)

Clear (0) When enabled (1), the driver reports a special column named documentAsJSON that retrieves or stores whole documents as JSON formatted strings. Note: See also the DocumentAsJSON driver configuration option.

Validate BSON Before Writes (ValidateBsonBeforeWrite)

Clear (0) By default, MongoDB does not validate BSON objects before insert/update, which can result in a corrupted database. If the value of ValidateBsonBeforeWrite is set to 1, then the driver validates all content prior to passing the content to the database server.

Check GetLastError on Writes (CheckGetLastError)

Selected (1) When set to the default value of 1, the driver calls the MongoDB CheckGetLastError() function after each insert/update to check for reported failures. Calling CheckGetLastError() typically takes four times longer than the actual insert/update operation, but is necessary if fault tolerance is important.

Rows Fetched Per Block (RowsFetchedPerBlock)

4096 The maximum number of rows that a query returns at a time

Page 27: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 22

Field Label (Key)

Default Value

Description

Nested Column Separator (NestedColumnSeparator)

__ (two underscore characters)

The separator to use with nested columns (for embedded documents and arrays). The separator can be single or multiple characters in length. Note: The driver assumes that the separator string would never occur in column names. MongoDB uses the period separator by default.

Rows to Scan (SchemaDetectSampleSize)

100 The number of rows to sample when detecting schema for a table

Read Preference (ReadPreference)

primary The Read Preference option defines how to route read operations to the members of a replica set.

String Column Lengths: Standard (DefaultStringColumnLength)

255 The default string column length to use. MongoDB does not provide the length for String columns in its column metadata. The option allows you to tune the length of String columns.

String Column Lengths: Container (DefaultContainerColumnLength)

511 The default column length to use with containers (arrays and objects) in MongoDB

String Column Lengths: DocumentAsJSON (DefaultJSONColumnLength)

1023 The default column length to use with documentAsJSON fields. Note: See also the Enable reading/writing as JSON document driver configuration option.

N/A (DefaultBinaryColumnLength)

32767 The default column length to use with binary data

Enable Updating Multiple Rows (UpdateMultipleRows)

Clear (0) When the option is disabled (0), then UPDATE statements update one row only even if multiple rows match the filters. When enabled (1), then all rows that match the filters are updated.

Page 28: Simba ODBC Driver with SQL Connector for MongoDB ... · To install the driver, you need Administrator privileges on the computer. Simba ODBC Driver with SQL Connector for MongoDB

Simba ODBC Driver with SQL Connector for MongoDB Installation and Configuration Guide

www.s imba .com 23

Field Label (Key)

Default Value

Description

Get Metadata From (LocalMetadataFile)

Clear When clear, then the driver loads metadata from the collection in the database named Mersenne_Collection_Metadata. When set to a file path, then the driver loads metadata from the local file specified in the file path. The metadata in the local file needs to be in a predefined JSON format.

Table 1 Advanced Configuration Options