Azure CosmosDB Mongo API with Tableau - mongodb

I'm attempting to connect Tableau desktop to our CosmosDB using the MongoDB API. Looks like the Azure Cosmos ODBC driver only supports CosmosDB using the SQL API, not using the MongoDB API. Are there any other ODBC drivers that will work with Cosmos DB Mongo API to get data into Tableau?
We've tried a third party driver by Cdata and this seems to work but we would like to use something free and officially supported by Microsoft.
Thanks,
Chris

Yes, the ODBC driver only supports SQL API. There is a driver for this, MongoDB Connector for BI. I would try this.

Was able to get the MongoDB Bi Connector to work.
Instructions:
Connecting to Tableau requires the installation of "MongoDB BI connector" suite and starting the mongosqld daemon.
The set of instructions to install and configure mongosqld deamon are described at https://www.mongodb.com/tableau?jmp=tbl.
To connect mongosqld to a CosmosDB account, use the following command line instead of the one mentioned in the above documentation
mongosqld.exe /mongo-uri:"mongodb://.documents.azure.com:10255" /mongo-username: /mongo-password:"" /mongo-ssl /mongo-sslAllowInvalidCertificates /mongo-minimumTLSVersion:TLS1_2 /auth /mongo-authenticationMechanism:PLAIN /sslPEMKeyFile:https://www.mongodb.com/tableau?jmp=tbl> /sslMode:requireSSL /defaultAuthMechanism:PLAIN
All the variables marked as <> (with the exception of sslPEMKeyFile) are listed in the Connection String page for your account in the Azure Portal
Once the MongoSQLD instance is started, start your Tableau client, select "MongoDB BI connector" and configure the USERNAME/PASSWORD as follows:
[1]: https://i.stack.imgur.com/lpyPK.png
(replace the location to ca.crt as generated using the key_cert_gen.sh script in https://www.mongodb.com/tableau?jmp=tbl )
Click on OK and "Sign In" and you should be able to access your MongoDB collections.

Related

MongoDB ODBC configuration for MongoDB BI Connector

I’m trying to setup MongoDB BI Connector to use it for Tableau. I have already running mongosqld and it is connecting successfully from windows cmd to aws documentdb, but when I try to setup MongoDB ODBC Data Source it shows Connection failed [MongoDB][ODBC 1.4(w) Driver] can’t connect to MySQL server on ‘xxxxx’. The same error is when trying unicode or ansi. It is also not working connecting directly from Tableau Desktop using MongoDB BI Connector. Same error message. I'm using port 3307. Perhaps anyone has had the same issue and can advise how to solve it?

MongoDB connection with Power BI

I have this mongoDB (a SaSS in IBM Cloud) and on this cloud i also have an instance of another noSQL DB, cloudant db.
We were able to connect the cloudant DB on Power BI using only an URL such as "https://8869f932-05f0-4f48-b697-XXXXXXXXXXXX-bluemix.cloudantnosqldb.appdomain.cloud/<DATABASE_NAME>/_design/<DESIGN_DOC_NAME>/_view/<VIEW_NAME>" and "WEB" connection option on PowerBI.
My question is, and i didn't find any info or documentation related to this matter: on MongoDB, there is a way to achieve this kind of connection, using only a uri to a specific view rather than the ODBC connection?
If not, is there any other alternative to connect with this resource on IBM instead of ODBC?
Install mongosqld from : https://docs.mongodb.com/bi-connector/current/installation/
Run mongosqld
Now you can connect to the mongodb instance with read access using mysql/mariadb client or drivers.
NOTE: As mentioned this only has read access, so you can execute all the select queries.
I don't think so if PowerBI doesn't support it already. The MongoDB BI Connector isn't installed in IBM Cloud Databases for MongoDB.

connect to documentdb using robomongo

I have a Document DB (using the DocumentDB interface, NOT the MongoDb interface), so the connection string looks like:
AccountEndpoint=https://SomeDatabase.documents.azure.com:443/;AccountKey=xxxxx;
it does NOT look like this:
mongodb://SomeDatabase:xxxxx==#SomeDatabase.documents.azure.com:10255/?ssl=true&replicaSet=globaldb
Question:
How do I connect using RoboMongo or other MongoDb tools/code?
The stuff I looked at said things like take the username (that it shows in the MongoDb version of Cosmos DB (which won't help, as it is a totally different database and the connection string there won't work for apps that need the DocumentDb interface)
Is there a way to do this,or by 'adding support for MongoDB interface to Document DB' like adding the ability to talk to a Ms-SQL Server using MongoDB because you can always download MongoDb an install that on the same machine. (and not be able to get any data passed between them)
When you use Cosmos DB, you must choose, for your deployed database, which API to use with it (DocumentDB, MongoDB, Tables, Gremlin). You cannot use multiple APIs against the same database.
The only way to use MongoDB tools & frameworks is to deploy a Cosmos DB database with the MongoDB API. The MongoDB API is what provides compatibility with MongoDB. Note: The oplog is not provided with the Cosmos MongoDB API, so tools that rely on reading/tailing the oplog will not work.
The DocumentDB API does not surface any of the MongoDB API, so you will not be able to use MongoDB-specific tools when deploying a DocumentDB-specific database.
Note: The MongoDB API of Cosmos does not surface an oplog, so any operations which attempt to query the oplog will not succeed.
Have you seen this how-to by Microsoft for this: Use Robomongo with an Azure Cosmos DB
And one more related: Connecting to Azure Cosmos DB emulator from RoboMongo

Azure Data Migration Tool

I am trying to migrate my mongoDB from mLab to Azure DocumentDB (with protocol support for mongoDB) using the data migration tool that Microsoft asks us to use, here is the link -https://www.microsoft.com/en-us/download/details.aspx?id=46436. The mlab mongoDb is trial version.
The connection string for mlab mongoDb is mongodb://dbuser:dbpassword#host:port/dbname
But the tool does not accept the connection string for the mLab mongoDB but accepts the one for my local mongoDB.
Has anyone else had this problem?
The data migration tool is designed to migrate to standard DocumentDB accounts. For migrating from MongoDB to a DocumentDB account with protocol support for MongoDB, I recommend standard MongoDB utilities such as mongoexport/mongoimport or mongodump/mongorestore.

How to Connect Mongodb to tableau

We are still in the development phase.
Our req is parse the XML to JSON and store them as flat files in Mongodb
Then for the analysis we want to use tableau.
Part 1 of the req is done...now i need to connect to tableau.
Versions we have are
Mongo 3.2
Tableau 9.1
I have googled and couldn't find any steps to integrate tableau with mongodb.
I also saw Mongodb has released a connector but there is no Windows BI connector.
Now do we need to migrate to Enterprise version for tableau connectivity.
Many thanks for the inputs
Detailed Instructions (for Windows), using localhost server of mongoDB:
1) Installation: Install Tableau, MongoDB, and MongoDB BI Connector for Tableau.
2) From the command prompt, you will want to serve your mongoDB instance as well as the mongoDB_sql server needed to connect to Tableau MongoDB BI Connector. Add mongoDB and mongoDB BI Connector bin's to your system path, for example: C:\Program Files\MongoDB\Server\3.6\bin\ and 2) C:\Program Files\MongoDB\Connector for BI\2.3\bin\.
3) Serve your local mongoDB server. Example command: mongod. (Let's assume it is served on localhost:27017.
4) Create a schema of the database you want Tableau to integrate with. Command to do this: mongodrdl --out <path_that_you_want_to_save_schema_to> /db:<name_of_database>
5) Validate the schema, and serve your local server of mongoDB as an SQL server (Tableau expects this server to be running). Command to do this: mongosqld --schema <path_to_schema> (** this will typically serve to localhost:3307)
6) You can now go to Tableau, under connectors, click on the MongoDB BI Connector, and enter localhost for the server, and 3307 for the port. (assuming in step 5 you have validated that the sql server is running on localhost with port 3307).
I hope this helps, these exact steps worked well for me.
The mongo biconnector is implemented as a multicorn (python) based Foreign Data Wrapper imbedded in the supplied postgresql server. Tools are provided to set up the postgresql "biuser" user, to create the collection to table mappings from data sampling, and to import the resultant schema into postgresql. The postgresql database contains non-materialized views corresponding to the (flattened) mongo collections. Access is through the postgresql server using standard postgresql jdbc/odbc drivers.
I think run mongodb bi connector in docker ubuntu/centos is a choice if the connector does not support windows, and tableau does not support linux, that's a question.
There is an example of create bi connection in www.mongodb.com/tableau with mongosqld
Hope this would work well for your issue
I have described our way connecting to data in MongoDB Community Edition to Tableau. First creat an API to your DB, then Web Data Connector to Tableau (it's HTML and JS files), after you can use WDC Connector in Tableau to connect to your URL.
Here is the detailed description how we did it: https://medium.com/#katya.neulinger/tableau-web-data-connector-to-mongodb-c1477d7d5ac9