{"id":16865,"date":"2022-01-13T16:57:20","date_gmt":"2022-01-13T15:57:20","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/"},"modified":"2025-10-24T09:38:39","modified_gmt":"2025-10-24T07:38:39","slug":"installing-the-odbc-drivers-for-mongodb","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/","title":{"rendered":"Installing the ODBC drivers for MongoDB"},"content":{"rendered":"<p>This article is part of a series that includes SQLite, Postgresql, Firebird, Oracle RDBMS, Microsoft SQL Server, HSQLDB, Excel, and MariaDB. The goal is to set up a self-standing environment for testing an ODBC extension for gawk presented here <em>to be completed<\/em>. Refer to <a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-driver-manager-with-sqlite-on-linux\">SQLite<\/a> for installing the required ODBC Driver Manager.<br \/>\nThe test system is a debian v11 (bullseye).<br \/>\nMongoDB is a noSQL database but the ODBC API will hide this fact and allow to access its data using SQL statements. This is to show that with the appropriate ODBC drivers doing the translation, any data source can be accessed using SQL. Not all native operations are rendered correctly of course (notably SELECT\u2019s JOIN clauses, see below) but the main ones, the CRUD, such as INSERT, SELECT, UPDATE and DELETE are all available.<br \/>\nAs root, install MongoDB Community Edition and its command-line tool from the official package repositories:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n# apt install mongodb\n# apt install mongodb-mongosh\n<\/pre>\n<p>Follow the instructions <a href=\"https:\/\/docs.mongodb.com\/manual\/tutorial\/install-mongodb-on-debian\/\">here<\/a> to configure and start mongodb.<br \/>\nA systemd service has been created. Still as root, start the service as shown below:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n# ulimit -n 64000\n# chown -R mongodb:mongodb \/var\/lib\/mongodb\n# systemctl stop mongod\n# systemctl start mongod\n# systemctl status mongod\n\u25cf mongod.service - MongoDB Database Server\n     Loaded: loaded (\/lib\/systemd\/system\/mongod.service; disabled; vendor preset: enabled)\n     Active: active (running) since Tue 2021-09-21 09:27:47 CEST; 3s ago\n       Docs: https:\/\/docs.mongodb.org\/manual\n   Main PID: 38200 (mongod)\n     Memory: 9.8M\n        CPU: 26ms\n     CGroup: \/system.slice\/mongod.service\n             \u2514\u250038200 \/usr\/bin\/mongod --config \/etc\/mongod.conf\n<\/pre>\n<p>Check the MongoDB server availability by connecting to the server through the mongosh tool documented <a href=\"https:\/\/docs.mongodb.com\/mongodb-shell\/\">here<\/a>:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n# mongosh\nCurrent Mongosh Log ID:\t6149ba4e6d2a951c4e869dac\nConnecting to:\t\tmongodb:\/\/127.0.0.1:27017\/?directConnection=true&amp;serverSelectionTimeoutMS=2000\nUsing MongoDB:\t\t5.0.3\nUsing Mongosh:\t\t1.0.6\ntest&gt; quit\n<\/pre>\n<p>The data sample site does not provide scripts for creating and populating MongoDB collections. There are 2 ways to work around this:<br \/>\n1.\tuse isql and ODBC to feed SQL statements to MongoDB;<br \/>\n2.\ttranslate SQL statements to javascripts ones suitable for MongoDB;<br \/>\nAt this stage, ODBC drivers are not installed yet and therefore isql cannot work so we will select the 2nd alternative. The script below will do just that. As a Mongo database is schema-less, there is no need to create collections beforehand, they will be implicitely created when populated with documents. Any sample populating script will do so we&#8217;ll take the one for mysql <a href=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2020\/04\/mysql-data.txt\">here<\/a> and save it to the file data4mongodb.sql. The script pop-mongodb.awk will convert SQL insert statements into MongoDB statements. Here it is:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n# format of the input lines, e.g:\n#   INSERT INTO regions(region_id,region_name) VALUES (1,'Europe');\n# or:\n#   INSERT INTO locations(location_id,street_address,postal_code,city,state_province,country_id) VALUES (2500,'Magdalen Centre, The Oxford Science Park','OX9 9ZB','Oxford','Oxford','UK');\n# Output:\n#    db.regions.insert({\n#    region_id: 1,\n#    region_name: \"Europe\"\n#    })\n# or:\n#    db.locations.insert({\n#    location_id: 2500,\n#    street_address: \"Magdalen Centre, The Oxford Science Park\",\n#    postal_code: \"OX9 9ZB\",\n#    city: \"Oxford\",\n#    state_province: \"Oxford\",\n#    country_id: \"UK\"\n#    })\n# Usage:\n#    gawk -v Apostrophe=\"'\" -f pop-mongodb.awk data4mongodb.sql &gt; data4mongodb.json\nBEGIN {\n   ApoRE=\"(([^,]+)|(\" Apostrophe \"([^\" Apostrophe \"]+)\" Apostrophe \")),?\" # i.e. (([^,]+)|('([^']+)')),?\n   print \"use sampledb\"\n}\n{\n   if (!$0 || match($0, \/^\/*\/)) next\n\n   match($0, \/INSERT INTO ([^(]+)(([^)]+))\/, stmt)\n   table_name = stmt[1]\n   if (!bemptied[table_name]) {\n      print \"db.\" table_name \".deleteMany({})\"\n      bemptied[table_name] = 1\n   }\n\n   nb_columns = split(stmt[2], columns, \",\")\n\n   nb = match($0, \/VALUES (([^)]+))\/, stmt)\n   S = stmt[1]\n   nb_values = 0\n   while (match(S, ApoRE, res)) {\n      values[++nb_values] = res[1]\n      S = substr(S, RLENGTH + 1)\n   }\n\n   print \"db.\" table_name \".insert({\"\n   for (i = 1; i &lt;= nb_columns; i++) {\n      if (&quot;NULL&quot; == values[i])\n         values[i] = &quot;null&quot;\n      gsub(Apostrophe, &quot;&quot;&quot;, values[i])\n      print columns[i] &quot;: &quot; values[i] (i &lt; nb_columns ? \",\" : \"\")\n   }\n   print \"})\"\n   printf \"n\"\n}\n<\/pre>\n<p>Invoke it:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\ngawk -v Apostrophe=\"'\" -f pop-mongodb.awk data4mongodb.sql &gt; data4mongodb.json\n<\/pre>\n<p>Example of input:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\nINSERT INTO regions(region_id,region_name) VALUES (1,'Europe');\n...\nINSERT INTO countries(country_id,country_name,region_id) VALUES ('AR','Argentina',2);\n...\nINSERT INTO locations(location_id,street_address,postal_code,city,state_province,country_id) VALUES (1400,'2014 Jabberwocky Rd','26192','Southlake','Texas','US');\n...\nINSERT INTO jobs(job_id,job_title,min_salary,max_salary) VALUES (1,'Public Accountant',4200.00,9000.00);\n...\nINSERT INTO departments(department_id,department_name,location_id) VALUES (1,'Administration',1700);\n...\nINSERT INTO employees(employee_id,first_name,last_name,email,phone_number,hire_date,job_id,salary,manager_id,department_id) VALUES (100,'Steven','King','steven.king@sqltutorial.org','515.123.4567','1987-06-17',4,24000.00,NULL,9);\n...\nINSERT INTO dependents(dependent_id,first_name,last_name,relationship,employee_id) VALUES (1,'Penelope','Gietz','Child',206);\n...\n<\/pre>\n<p>and their corresponding generated json statements:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1]\">\nuse sampledb\ndb.regions.deleteMany({})\ndb.regions.insert({\nregion_id: 1,\nregion_name: \"Europe\",\n})\n...\ndb.countries.deleteMany({})\ndb.countries.insert({\ncountry_id: \"AR\",\ncountry_name: \"Argentina\",\nregion_id: 2,\n})\n...\ndb.locations.deleteMany({})\ndb.locations.insert({\nlocation_id: 1400,\nstreet_address: \"2014 Jabberwocky Rd\",\npostal_code: \"26192\",\ncity: \"Southlake\",\nstate_province: \"Texas\",\ncountry_id: \"US\",\n})\n...\ndb.jobs.deleteMany({})\ndb.jobs.insert({\njob_id: 1,\njob_title: \"Public Accountant\",\nmin_salary: 4200.00,\nmax_salary: 9000.00,\n})\n...\ndb.departments.deleteMany({})\ndb.departments.insert({\ndepartment_id: 1,\ndepartment_name: \"Administration\",\nlocation_id: 1700,\n})\n...\ndb.employees.deleteMany({})\ndb.employees.insert({\nemployee_id: 100,\nfirst_name: \"Steven\",\nlast_name: \"King\",\nemail: \"steven.king@sqltutorial.org\",\nphone_number: \"515.123.4567\",\nhire_date: \"1987-06-17\",\njob_id: 4,\nsalary: 24000.00,\nmanager_id: null,\ndepartment_id: 9,\n})\n...\ndb.dependents.deleteMany({})\ndb.dependents.insert({\ndependent_id: 1,\nfirst_name: \"Penelope\",\nlast_name: \"Gietz\",\nrelationship: \"Child\",\nemployee_id: 206,\n})\n<\/pre>\n<p>To be sure the populating step is idempotent, the collections are emptied each time the script is run.<br \/>\nFrom mongosh, populate the tables as shown:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\nmongosh &lt; data4mongodb.isql\n<\/pre>\n<p>Back in mongosh, check the data:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\nmongosh  show databases\nadmin       41 kB\nconfig     111 kB\nlocal     81.9 kB\nsampledb   516 kB\n\ntest&gt; use sampledb\nswitched to db sampledb\n\nsampledb&gt; show collections\ncountries\ndepartments\ndependents\nemployees\njobs\nlocations\nregions\n\nsampledb&gt; db.regions.find()\n[\n  {\n    _id: ObjectId(\"616eef8e230e4e4893edd45f\"),\n    region_id: 1,\n    region_name: 'Europe'\n  },\n...\nsampledb&gt; db.countries.find()\n[\n  {\n    _id: ObjectId(\"616eef8f230e4e4893edd463\"),\n    country_id: 'AR',\n    country_name: 'Argentina',\n    region_id: 2\n  },\n...\nsampledb&gt; db.locations.find()\n[\n  {\n    _id: ObjectId(\"616eef91230e4e4893edd47c\"),\n    location_id: 1400,\n    street_address: '2014 Jabberwocky Rd',\n    postal_code: '26192',\n    city: 'Southlake',\n    state_province: 'Texas',\n    country_id: 'US'\n  },\n...\nsampledb&gt; db.jobs.find()\n[\n  {\n    _id: ObjectId(\"616eef92230e4e4893edd483\"),\n    job_id: 1,\n    job_title: 'Public Accountant',\n    min_salary: 4200,\n    max_salary: 9000\n  },\n...\nsampledb&gt; db.departments.find()\n[\n  {\n    _id: ObjectId(\"616eef94230e4e4893edd496\"),\n    department_id: 1,\n    department_name: 'Administration',\n    location_id: 1700\n  },\n...\nsampledb&gt; db.employees.find()\n[\n  {\n    _id: ObjectId(\"616eef95230e4e4893edd4a1\"),\n    employee_id: 100,\n    first_name: 'Steven',\n    last_name: 'King',\n    email: 'steven.king@sqltutorial.org',\n    phone_number: '515.123.4567',\n    hire_date: '1987-06-17',\n    job_id: 4,\n    salary: 24000,\n    manager_id: null,\n    department_id: 9\n  },\n...\nsampledb&gt; db.dependents.find()\n[\n  {\n    _id: ObjectId(\"616eef9c230e4e4893edd4c9\"),\n    dependent_id: 1,\n    first_name: 'Penelope',\n    last_name: 'Gietz',\n    relationship: 'Child',\n    employee_id: 206\n  },\n...\nsampledb&gt; quit\n<\/pre>\n<p>The MongoDB ODBC drivers are available <a href=\"https:\/\/github.com\/mongodb\/mongo-odbc-driver#mongodb-odbc-driver\">here<\/a>. They are a modified version of MySQL ODBC driver. However, they don&#8217;t work on my test machine running Debian Linux v11 because of a missing openssl v1.0.2 library, which was predictable because those drivers are several years old and my test machine runs the latest Debian linux. For this reason, a commercial replacement from Devart has been installed; it comes with a one-month evaluation period. Once registered, it can be downloaded and installed as root as follows:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n# wget https:\/\/www.devart.com\/odbc\/mongodb\/devartodbcmongo_amd64.deb\n# apt install \/home\/debian\/Downloads\/devartodbcmongo_amd64.deb\n<\/pre>\n<p>Check the system-wide installed drivers:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1,7]\">\n# odbcinst -q -d\n...\n[MongoDB Unicode]\n[MongoDB ANSI]\n...\n[Devart ODBC Driver for MongoDB]\n# odbcinst -q -d -n \"Devart ODBC Driver for MongoDB\"\n[Devart ODBC Driver for MongoDB]\nDriver=\/usr\/local\/lib\/libdevartodbcmongo.so\n<\/pre>\n<p>Check the system-wide DSN in \/etc\/odbc.ini:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1,4]\">\n# odbcinst -q -s\n...\n[DEVART_MONGODB]\n#  odbcinst -q -s -n \"DEVART_MONGODB\"\n[DEVART_MONGODB]\nDescription=My MongoDB sample database\nDriver=Devart ODBC Driver for MongoDB\nData Source=\nPort=27017\nDatabase=sampledb\nUser ID=\nPassword=\nClient Library=\nBSON Library=\nAdditional Servers=\nConnection Options=\n<\/pre>\n<p>Copy the newly inserted DSN into debian&#8217;s ~\/.odbc.ini file:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1]\">\n$ vi ~\/.odbc.ini\n...\n[DEVART_MONGODB]\nDescription=My MongoDB sample database\nDriver=Devart ODBC Driver for MongoDB\nData Source=\nPort=27017\nDatabase=sampledb\nUser ID=\nPassword=\nClient Library=\nBSON Library=\nAdditional Servers=\nConnection Options=\n<\/pre>\n<p>As debian, check its DSN so far:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1,6]\">\n$ odbcinst -q -s\n...\n[DEVART_MONGODB]\n...\n\n$ odbcinst -q -s -n DEVART_MONGODB\n[DEVART_MONGODB]\nDescription=My MongoDB sample database\nDriver=Devart ODBC Driver for MongoDB\nData Source=\nPort=27017\nDatabase=sampledb\nUser ID=\nPassword=\nClient Library=\nBSON Library=\nAdditional Servers=\nConnection Options=\n<\/pre>\n<p>Try a connection to the MongoDB database via ODBC:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1]\">\nisql -v DEVART_MONGODB\n+---------------------------------------+\n| Connected!                            |\n|                                       |\n| sql-statement                         |\n| help [tablename]                      |\n| quit                                  |\n|                                       |\n+---------------------------------------+\nSQL&gt; help\n+-----------+-------------+-------------+------------+---------+\n| TABLE_CAT | TABLE_SCHEM | TABLE_NAME  | TABLE_TYPE | REMARKS |\n+-----------+-------------+-------------+------------+---------+\n| sampledb  |             | countries   | TABLE      |         |\n| sampledb  |             | dependents  | TABLE      |         |\n| sampledb  |             | regions     | TABLE      |         |\n| sampledb  |             | locations   | TABLE      |         |\n| sampledb  |             | departments | TABLE      |         |\n| sampledb  |             | jobs        | TABLE      |         |\n| sampledb  |             | employees   | TABLE      |         |\n+-----------+-------------+-------------+------------+---------+ \nSQLRowCount returns -1\n7 rows fetched\n<\/pre>\n<p>It looks good. Run the test query now:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\nSQL&gt; SELECT c.country_name, c.country_id, l.country_id, l.street_address, l.city FROM countries c LEFT JOIN locations l ON l.country_id = c.country_id WHERE c.country_id IN ('US', 'UK', 'CN');\nOutput:\n+--------------+-----------------+-----------------+----------------+------+\n| country_name | country_id      | country_id_1    | street_address | city |\n+--------------+-----------------+-----------------+----------------+------+\n| China        | CN              |                 |                |      |\n+--------------+-----------------+-----------------+----------------+------+ \nSQLRowCount returns -1\n1 rows fetched\n<\/pre>\n<p>Only one row is returned because the left join is not implemented in the combo MongoDB\/ODBC driver. In effect, joins in relational database are a necessity due to the data normalization; as MongoDB does not care about data duplication and works with complete, self-standing documents, no joins are necessary although inner queries can be simulated with aggregate() and lookup() as illustrated by the following equivalent query:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\ndb.countries.aggregate([\n   {\n      $match:{$or:[{\"country_id\" : \"US\"}, {\"country_id\" : \"UK\"}, {\"country_id\" : \"CN\"}]}\n   },\n   {\n     $lookup:\n       {\n         from: \"locations\",\n         localField: \"country_id\",\n         foreignField: \"country_id\",\n         as: \"r\"\n       }\n  }\n])\n<\/pre>\n<p>with its result:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n[\n  {\n    _id: ObjectId(\"616eef90230e4e4893edd469\"),\n    country_id: 'CN',\n    country_name: 'China',\n    region_id: 3,\n    r: []\n  },\n  {\n    _id: ObjectId(\"616eef91230e4e4893edd478\"),\n    country_id: 'UK',\n    country_name: 'United Kingdom',\n    region_id: 1,\n    r: [\n      {\n        _id: ObjectId(\"616eef92230e4e4893edd480\"),\n        location_id: 2400,\n        street_address: '8204 Arthur St',\n        postal_code: null,\n        city: 'London',\n        state_province: null,\n        country_id: 'UK'\n      },\n      {\n        _id: ObjectId(\"616eef92230e4e4893edd481\"),\n        location_id: 2500,\n        street_address: 'Magdalen Centre, The Oxford Science Park',\n        postal_code: 'OX9 9ZB',\n        city: 'Oxford',\n        state_province: 'Oxford',\n        country_id: 'UK'\n      }\n    ]\n  },\n  {\n    _id: ObjectId(\"616eef91230e4e4893edd479\"),\n    country_id: 'US',\n    country_name: 'United States of America',\n    region_id: 2,\n    r: [\n      {\n        _id: ObjectId(\"616eef91230e4e4893edd47c\"),\n        location_id: 1400,\n        street_address: '2014 Jabberwocky Rd',\n        postal_code: '26192',\n        city: 'Southlake',\n        state_province: 'Texas',\n        country_id: 'US'\n      },\n      {\n        _id: ObjectId(\"616eef91230e4e4893edd47d\"),\n        location_id: 1500,\n        street_address: '2011 Interiors Blvd',\n        postal_code: '99236',\n        city: 'South San Francisco',\n        state_province: 'California',\n        country_id: 'US'\n      },\n      {\n        _id: ObjectId(\"616eef91230e4e4893edd47e\"),\n        location_id: 1700,\n        street_address: '2004 Charade Rd',\n        postal_code: '98199',\n        city: 'Seattle',\n        state_province: 'Washington',\n        country_id: 'US'\n      }\n    ]\n  }\n]\n<\/pre>\n<p>To easy up the comparaison, we save that output to the file mongodb.out and run the following commands to reformat it into a tabular presentation.<br \/>\nFirst, convert mongodb.out to correct json syntax:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n$ gawk -v Apo=\"'\" '{\n   gsub(Apo, \"\"\", $0)\n   if (match($1, \/^_id\/)) next\n   print gensub(\/^( +)([^:]+)(:.+$)\/, \"\\1\"\\2\"\\3\", \"g\", $0)\n}' mongodb.out &gt; mongodb.json\n<\/pre>\n<p>Now, save the following python script into the python script mongodb2tab.py:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1]\">\n$ cat - &lt;&lt;eop mongodb2tab.py\nimport os\nimport json\nwith open(\".\/mongodb.json\") as json_file:\n   mongodb_out = json.load(json_file)\nwidths = [25, 10, 10, 42, 10]\nprint(f\"{'country_name': &lt;{widths[0]}}  {&#039;country_id&#039;: &lt;{widths[1]}}  {&#039;country_id&#039;: &lt;{widths[2]}}  {&#039;street_address&#039;: &lt;{widths[3]}}  {&#039;city&#039;: &lt;{widths[4]}}&quot;)\nfor row in mongodb_out:\n   if row[&#039;r&#039;]:\n      for l in row[&#039;r&#039;]:\n         print(f&quot;{row[&#039;country_name&#039;]: &lt;{widths[0]}}  {row[&#039;country_id&#039;]: &lt;{widths[1]}}  {l[&#039;country_id&#039;]: &lt;{widths[2]}}  {l[&#039;street_address&#039;]: &lt;{widths[3]}}  {l[&#039;city&#039;]: &lt;{widths[4]}}&quot;)\n   else:\n      print(f&quot;{row[&#039;country_name&#039;]: &lt;{widths[0]}}  {row[&#039;country_id&#039;]: &lt;{widths[1]}}&quot;)\neop\n<\/pre>\n<p>Finally, execute it:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [1]\">\n$ python3 mongodb2tab.py\nOutput:\ncountry_name               country_id  country_id  street_address                              city      \nChina                      CN        \nUnited Kingdom             UK          UK          8204 Arthur St                              London    \nUnited Kingdom             UK          UK          Magdalen Centre, The Oxford Science Park    Oxford    \nUnited States of America   US          US          2014 Jabberwocky Rd                         Southlake \nUnited States of America   US          US          2011 Interiors Blvd                         South San Francisco\nUnited States of America   US          US          2004 Charade Rd                             Seattle   \n<\/pre>\n<p>Which shows that the output of the MongoDb query to simulate the left outer join was correct.<br \/>\nLet\u2019s now test the DSN with pyodbc:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []\">\n$ python3\nimport pyodbc \ncnxn = pyodbc.connect(DSN=&#039;mymongodb_Devart&#039;)\ncursor = cnxn.cursor()\t\ncursor.execute(\"\"\"SELECT\n        c.country_name,\n        c.country_id,\n        l.country_id,\n        l.street_address,\n        l.city\nFROM\n        countries c\nLEFT JOIN locations l ON l.country_id = c.country_id\nWHERE\n        c.country_id IN ('US', 'UK', 'CN')\"\"\")\nrow = cursor.fetchone() \nwhile row:\n    print (row) \n    row = cursor.fetchone()\nOutput:\n(&#039;China&#039;, &#039;CN&#039;, None, None, None)\n<\/pre>\n<p>Here too, there are missing values as expected.<br \/>\nMongoDB is now accessible from ODBC under the debian account, albeit not all SQL statements are fully supported, which is understandable with a NoSQL database.<br \/>\nInstructions for the other data sources can be accessed through the following links:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-driver-manager-with-sqlite-on-linux\">SQLite<\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-firebird\">Firebird<\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-hsqldb\">HSQLDB<\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mariadb\">MariaDB<\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-postgresql\">PostgreSQL<\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-oracle-rdbms\">Oracle<\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-microsoft-sqlserver-for-linux\">Microsoft SQLServer for Linux<\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-cdata-odbc-drivers-for-excel\/\">Excel<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of a series that includes SQLite, Postgresql, Firebird, Oracle RDBMS, Microsoft SQL Server, HSQLDB, Excel, and MariaDB. The goal is to set up a self-standing environment for testing an ODBC extension for gawk presented here to be completed. Refer to SQLite for installing the required ODBC Driver Manager. The test system [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,368],"tags":[],"type_dbi":[],"class_list":["post-16865","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-development-performance"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Installing the ODBC drivers for MongoDB - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing the ODBC drivers for MongoDB\" \/>\n<meta property=\"og:description\" content=\"This article is part of a series that includes SQLite, Postgresql, Firebird, Oracle RDBMS, Microsoft SQL Server, HSQLDB, Excel, and MariaDB. The goal is to set up a self-standing environment for testing an ODBC extension for gawk presented here to be completed. Refer to SQLite for installing the required ODBC Driver Manager. The test system [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-13T15:57:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-24T07:38:39+00:00\" \/>\n<meta name=\"author\" content=\"Middleware Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Middleware Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/\"},\"author\":{\"name\":\"Middleware Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"headline\":\"Installing the ODBC drivers for MongoDB\",\"datePublished\":\"2022-01-13T15:57:20+00:00\",\"dateModified\":\"2025-10-24T07:38:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/\"},\"wordCount\":703,\"commentCount\":0,\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Development &amp; Performance\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/\",\"name\":\"Installing the ODBC drivers for MongoDB - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2022-01-13T15:57:20+00:00\",\"dateModified\":\"2025-10-24T07:38:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing the ODBC drivers for MongoDB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\",\"name\":\"Middleware Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"caption\":\"Middleware Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Installing the ODBC drivers for MongoDB - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/","og_locale":"en_US","og_type":"article","og_title":"Installing the ODBC drivers for MongoDB","og_description":"This article is part of a series that includes SQLite, Postgresql, Firebird, Oracle RDBMS, Microsoft SQL Server, HSQLDB, Excel, and MariaDB. The goal is to set up a self-standing environment for testing an ODBC extension for gawk presented here to be completed. Refer to SQLite for installing the required ODBC Driver Manager. The test system [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/","og_site_name":"dbi Blog","article_published_time":"2022-01-13T15:57:20+00:00","article_modified_time":"2025-10-24T07:38:39+00:00","author":"Middleware Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Middleware Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/"},"author":{"name":"Middleware Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"headline":"Installing the ODBC drivers for MongoDB","datePublished":"2022-01-13T15:57:20+00:00","dateModified":"2025-10-24T07:38:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/"},"wordCount":703,"commentCount":0,"articleSection":["Database Administration &amp; Monitoring","Development &amp; Performance"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/","url":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/","name":"Installing the ODBC drivers for MongoDB - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2022-01-13T15:57:20+00:00","dateModified":"2025-10-24T07:38:39+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-drivers-for-mongodb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Installing the ODBC drivers for MongoDB"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1","name":"Middleware Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","caption":"Middleware Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=16865"}],"version-history":[{"count":1,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16865\/revisions"}],"predecessor-version":[{"id":41196,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16865\/revisions\/41196"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=16865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=16865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=16865"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=16865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}