Overview
Version
FineDataLink Version | Functional Change |
---|---|
4.0.4.2 |
|
Application Scenario
You may need to use FineDataLink to process data in the MongoDB database.
Function Description
This function allows you to fetch data from the MongoDB data source for processing.
Prerequisite
1. Before using this function, ensure that the NoSQL function point has been registered in FineDataLink. For details, see Registration Introduction.
2. You have created a MongoDB data connection.
Function Description
The MongoDB Input operator allows you to read data from a MongoDB collection, as shown in the following figure.
For details about how to process the fetched data, see Overview of Scheduled Task.
The following table describes the setting items.
Setting Item | Description |
---|---|
Data Connection | The drop-down list displays existing MongoDB data connections on which you have Use permission. |
Database | The drop-down list displays all the databases connected via the selected data connection. |
Connection | The drop-down list displays all the collections in the selected database. |
Request Type | Only the selected configuration method takes effect, and only the query condition corresponding to the selected method is saved. The query condition of each request type works independently and will not be cleared if you switch the request type. The result field after the query is displayed in Output Field. |
Configure Condition | This item is displayed when you select Conditional Query (Find). For details, see MongoDB Comparison Query Operators. Convert the time in the query expression to time in GMT. ![]() In FineDataLink V4.1.1 and later versions, the product logic for condition judgment has been standardized. For details about each operator, see Judgment Logic Description. You can use parameters configured in FineDataLink. For details, see Parameter Configuration and Use. |
Query Statement | The statement input box is displayed when you select Statement Query (Find). Enter the query condition in JSON format, namely, the content inside the brackets of find(). Parameters are supported. For details, see MongoDB Document Query. Format: {key1:value1, key2:value2} {$or: [{key1: value1}, {key2:value2}]} Empty content is allowed. If the content is empty, no query condition is specified, and all documents in the collection will be queried. You can use parameters configured in FineDataLink. For details, see Parameter Configuration and Use. |
Aggregate Statement | You can use the aggregate() method when selecting Statement Aggregation (Aggregate). Enter the aggregate query in JSON format, namely, the content inside the brackets of aggregate(). Parameters are supported. For details, see MongoDB Aggregation. Format: [{$group:{_id:"$by_user",num_tutorial:{$sum:1}}}] {$project:{_id:0,title:1,author:1}} Empty content is allowed. If the content is empty, no aggregation is specified. ![]() 1. The Java driver of MongoDB cannot parse new Date(“YYYY-MM-DD”) in aggregate queries. You need to replace new Date with ISODate in the aggregate queries. 2. The LIMIT clause is supported in Statement Aggregation (Aggregate). You can use parameters configured in FineDataLink. For details, see Parameter Configuration and Use. |
Output Field | You can configure the output fields. 1. Field Name
2. Field Type: You can select the field type from the drop-down list. |