Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Viewing MongoDB Data in RAD Studio Data Explorer
How to view MongoDB data in RAD Studio Data Explorer using the CData ODBC Driver for MongoDB.
Embarcadero RAD Studio provides a development environment for Delphi and C++Builder applications. With the CData ODBC Driver for MongoDB, you gain access to live MongoDB data within RAD Studio, abstracting the data into tables, views, and stored procedures that can be used to both retrieve and update MongoDB data. This article will walk through connecting to MongoDB using the Data Explorer.
About MongoDB Data Integration
Accessing and integrating live data from MongoDB has never been easier with CData. Customers rely on CData connectivity to:
- Access data from MongoDB 2.6 and above, ensuring broad usability across various MongoDB versions.
- Easily manage unstructured data thanks to flexible NoSQL (learn more here: Leading-Edge Drivers for NoSQL Integration).
- Leverage feature advantages over other NoSQL drivers and realize functional benefits when working with MongoDB data (learn more here: A Feature Comparison of Drivers for NoSQL).
MongoDB's flexibility means that it can be used as a transactional, operational, or analytical database. That means CData customers use our solutions to integrate their business data with MongoDB or integrate their MongoDB data with their data warehouse (or both). Customers also leverage our live connectivity options to analyze and report on MongoDB directly from their preferred tools, like Power BI and Tableau.
For more details on MongoDB use case and how CData enhances your MongoDB experience, check out our blog post: The Top 10 Real-World MongoDB Use Cases You Should Know in 2024.
Getting Started
Configure a Connection to MongoDB
If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.
Set the Server, Database, User, and Password connection properties to connect to MongoDB. To access MongoDB collections as tables you can use automatic schema discovery or write your own schema definitions. Schemas are defined in .rsd files, which have a simple format. You can also execute free-form queries that are not tied to the schema.
Connecting to MongoDB Data Using Data Explorer
You can create a simple application for displaying MongoDB data by utilizing the CData FireDAC Components for MongoDB and a new VCL Forms Application:
- Open the Data Explorer in RAD Studio and expand FireDAC.
- Right-click the ODBC Data Source node in the Data Explorer.
- Click Add New Connection.
- Enter a name for the connection.
- In the FireDAC Connection Editor that appears, set the DataSource property to the name of the ODBC DSN for MongoDB.
- Back in the Data Explorer, expand the tables for the connection.
Create a new VCL Forms application and drag a table (for example: restaurants) onto the form.
- Select the restaurantsTable object on the form and set the Active property to true.
Right-click on the object, bind visually, and link everything (*) to a new control (TStringGrid).
Arrange the TStringGrid on the form and run the application to see the restaurants data.
Related Articles
Below you can find other articles for using the CData ODBC Driver with RAD Studio, Delphi, and C++ Builder.