SAP recently announced partnership with MongoDB at SAPPHIRE NOW. Future Versions of SAP Lumira would have native integration capability to connect with MongoDB directly. This will now enable customers to visualize data from all sources irrespective of relational or non-relational data. However with the current version, we can still connect to MongoDB using the two methods that we will be discussing in this blog.

In the first part of this blog, we will be using OData to connect to MongoDB.

SAP Lumira can fetch and process data from an OData feed by using the open OData 2.0 driver provided along with it. By exposing MongoDB collections as OData, the same can be consumed by Lumira for visualization. The OData feeds update as the documents in the collection update. This is a generic way.

MongoDB as OData:
Windows Communication Service (WCF) is a framework for building service-oriented applications. It can define the endpoint as MongoDB and expose them as OData, which then can be used in any applications that can work on OData. MongoDB driver for .NET is used to make the web application communicate with MongoDB and retrieve data. MongoDB service should be running throughout the process.

Step 1: A blank .NET 4.0 MVC web application (solution) is created in Visual Studio and by using NuGet packet manager, the driver and the web service for MongoDB is added to the solution as a source package. The NuGet console can be accessed by Tools->NuGet package Manager->Package Manager Console.

Connecting SAP Lumira with MongoDB – Part 1

If the NuGet package manager is missing, it can be installed using the Extensions manager in the Tools menu.

Connecting SAP Lumira with MongoDB – Part 1

Step 2: The command Install-Package MongOData executed in the NuGet console downloads and adds the files to the blank solution.

Connecting SAP Lumira with MongoDB – Part 1

Step 3: Web.config holds the configuration information for the connectivity options to MongoDB. The connection string is updated with the URL of MongoDB Database.

add name=”MongoDB” connectionString=”mongodb://localhost/TESLA”/

The format for connectionString is mongodb://: / The port can be omitted if instance is running on default port. The application can be published to IIS or can be executed in the local development server. MongoDataService.svc is the end point for OData and it can be opened in browser to view the collections of the database as OData.

Connecting SAP Lumira with MongoDB – Part 1

Connecting to MongoDB using OData:
Step 4: The Generic OData 2.0 is selected as the data source in Lumira.

Connecting SAP Lumira with MongoDB – Part 1

The OData URL is then used and Lumira displays the list of collections from MongoDB.

Additional details like Username, password and proxy information are optional and can be skipped for default configurations of MongoDB.

Connecting SAP Lumira with MongoDB – Part 1

The Visualization can then be built from the Data available from the collection that was imported.

Connecting SAP Lumira with MongoDB – Part 1
Connecting SAP Lumira with MongoDB – Part 1

For MongoDB running on other platforms, the same can be achieved by using OData server in nodejs and exposing MongoDB collections as OData and consuming the same in Lumira.

We have seen how OData can be used effectively for connecting SAP Lumira and MongoDB. In the next series of the blog we will be using JDBC to connect Lumira and MongoDB.

Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!