rvmongodataprovider TRVReportFDMongoDataProvider


<< Click to display table of contents >>

rvmongodataprovider TRVReportFDMongoDataProvider


A data provider receiving data from MongoDB databases via FireDAC.

Unit RVReportFDMongoDataProvider;


TRVReportFDMongoDataProvider = class (TRVReportCustomFDMongoDataProvider)



This component provides data for a report generator component from MogoDB databases via FireDAC. FireDAC for MongoDB components are included in RAD Studio since 10 Seattle version.

This data provider handles the following data queries:

JSON queries containing $match, $sort, $limit, $project, $skip, $database, $collection items

JSON queries containing only $match part

Examples of data queries:

// complete query syntax


     {"cuisine": "Italian", "address.zipcode": "10075"}},

// $match query syntax

  '{"cuisine": "Italian", "address.zipcode": "10075"}');
// returning the whole collection:

To use this component, assign it to DataProvider property of TRVReportGenerator.

TRVReportFDMongoDataProvider introduces properties:

property Connection: TFDCustomConnection;
property DatabaseName: String;
property CollectionName: String;

Also: FieldOptions, ObjectView, LocalSQL property.

Database and Collection property specify the default values. They can be overridden by $database and $collection items in a data query.

Internally, the component uses temporal TFDMongoQuery components to handle data queries. The data provider properties and events are assigned to these components. If you want to assign additional properties to them, use OnDataSetCreated event.

In addition to the default query processing, you can provide another DataSet component in OnCreateDataSet event. This DataSet is not necessary needed to be TFDMongoQuery.

See also

Definitions of Report Workshop terms

Data queries