Categories
DataBase Source Code

New Delphi Seattle MongoDB Sample

I created some more Delphi 10 Seattle samples to show off MongoDB and FireDAC functionality: LocalSQL, Indexing & Geospatial.

FireDAC MongoDB NoSQL

The first one queries some data from MongoDB allowing you to specify the match, sort and projection, then it stores the results in a DataSet. At that point you can use LocalSQL to write a SQL query against the result set. While FireDAC gives you full native support for MongoDB, it also puts the SQL back into NoSQL.

MongoDB FireDAC LocalSQL

Indexing is used to improve your query performance. It is really easy to work with MongoDB queries with FireDAC.

MongoDB FireDAC Indexes

And one of the cool features of MongoDB is that you can do spatial queries. Here is an example that shows how to create a Spatial index and then do a spatial query with FireDAC. This uses the restaurant data that is included with the shipping samples, so make sure you load the restaurant data first.

Geospatial MongoDB FireDAC

If you missed my previous post I had a MongoDB FireDAC and C++Builder sample.

[You can download my new samples here.]

Categories
DataBase

MongoDB FireDAC C++ Sample

I created a simple sample that shows some basic FireDAC functionality with MongoDB in C++ (Works with C++Builder or RAD Studio 10 Seattle)

MongoDB FireDAC C++

This is similar to a one of the Object Pascal / Delphi MongoDB sample. It shows how you can query a MongoDB database using the new TFDMongoQuery component and display it in a grid. It also shows how to handle nested document objects (like Address) and arrays / DataSets (Address.Coords and Grades).

In addition to using the match property of the query, it also allows the specification of a sort and a projection. The projection is used to change which fields of the document you retrieve.

For more information on MongoDB, check out my MongoDB Skill Sprint and register for CodeRage X (Oct 13 – 15)

FireDAC MongoDB NoSQL