Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Hit The Ground Running With Windows Native MongoDB Database Sample Apps For Delphi

MongoDB is a document database, which means it stores data in JSON-like documents, the most natural way to think about data, and is much more expressive and powerful than the traditional row/column model. How about connecting with MongoDB and exploring the available databases and data using FireDAC components in your Application. Don’t know where to start? This post will guide you to do that.

MongoDB.Explore Sample App shows how to connect to available MongoDB Databases, access to its ListCollections, and populate to the grid using MongoDB API wrapper class.

You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Components used in MangoDB.Explore Sample App:

Implementation Details:

You can find the MongoDB Explore Demo sample project at: Object PascalDatabaseFireDACSamplesDBMS SpecificMongoDBMongo_Explore.dproj. Before running this, as a preliminary step, we need to have a MongoDB Server is running and accessible from your host. For Details, See Connect to MongoDB Database.

Check the below screen for listing the databases in the MongoDB server. Upon changing the database, its list collections changes. This screen Demonstrates the “restaurants” collection of the “test” database is provisioned with test data. To provision this collection, run the MongoDB Restaurants Demo, and click the Load Data button: You can find the MongoDB Restaurants Demo sample project at: Object PascalDatabaseFireDACSamplesDBMS SpecificMongoDBRestaurants

Check out the full article in the DocWiki about the MongoDB.Explore Sample.

Check out the full source code for the MongoDB.Explore projects for Delphi over on GitHub.

Check out the full source code for MondoDB samples in C++ over on GitHub.

Exit mobile version