Applies to:
Denodo 8.0
,
Denodo 7.0
,
Denodo 6.0
Last modified on: 01 Mar 2021
Tags:
Cloud
MongoDB
NoSQL
Goal
This document describes how to access MongoDB from the Denodo Platform.
Content
MongoDB is an open source NoSQL database that uses a document-oriented database model which supports various forms of data. Instead of using tables and rows as in relational databases, the MongoDB architecture is made up of collections and documents. It provides high performance, high availability, and automatic scaling
The Denodo MongoDB Custom Wrapper available at the Denodo Support Site allows users to connect to any mongoDB database using the collections as a data source for Virtual DataPort.
Connecting to MongoDB from the Denodo Platform
Importing the custom wrapper into Virtual DataPort
The Denodo MongoDB Custom Wrapper component is available to download for Denodo support users from the “Downloads > Denodo Connects” section of the Denodo Support Site.
In order to use the Denodo MongoDB Custom Wrapper in Virtual DataPort, configure the Virtual DataPort Administration Tool to import the extension.
From the denodo-mongodb-customwrapper distribution, select the denodomongodb-
customwrapper-${version}-jar-with-dependencies.jar file and upload it to Virtual DataPort. To do so, from the Virtual DataPart Administration tool:
Go to “File > Extension management” and create a new item selecting the jar file.
Creating a Data Source
127.0.0.1.
[mongodb://]host1[:port1][,host2[:port2],...[,hostN[:portN]]]/database[?
Options]
The prefix mongodb:// is optional, the database is mandatory and user and password are not written in this field, but in the User and Password Parameters.
Make a note that, if you introduce this parameter, Host, Port and Database parameters should be empty.
Authenticate against a different database
In MongoDB it is possible to authenticate against a database but read the data from a different one. When the authentication is done in a different database, you have to add the option authsource in the Connection String parameter and leave the parameters Host, Port and Database empty as in the screenshot below.
More details about authsource can be found in the Connection Options of the Connection String URI here.
Creating a Base view
Once the data source is created, create base views for that particular source. In order to do that click on the "Create Base View" option.
There are also two parameters that are mutually exclusive:
field1[:type1][,field2[:type2],...].
Type, when specified, should be one of the constants in java.sql.Types (note these are SQL standard types).
The below image is an example of creating a base view over the MongoDB datasource.
References
Virtual DataPort Administration Guide: Custom Data Sources
Denodo MongoDB Custom Wrapper - User Manual