All Products
Search
Document Center

Dataphin:Configure MongoDB Input Widget

Last Updated:May 28, 2025

The MongoDB input widget enables reading data from a MongoDB data source. When synchronizing data from MongoDB to another data source, configure the MongoDB input widget to access the data, followed by setting up the target data source for synchronization. This topic describes the configuration process for the MongoDB input widget.

Prerequisites

  • You have successfully created a MongoDB data source. For more information, see Create a MongoDB Data Source.

  • To configure the MongoDB input widget properties, the account must possess read-through permission for the data source. If permission is lacking, you need to request access to the data source. For more information, see Request Data Source Permission.

Procedure

  1. Select Development > Data Integration from the top menu bar on the Dataphin home page.

  2. On the integration page, select Project from the top menu bar (select an environment if using the Dev-Prod pattern).

  3. In the left-side navigation pane, click on the Batch Pipeline. From the Batch Pipeline list, select the offline pipeline you want to develop to access its configuration page.

  4. To open the Component Library panel, click Component Library located in the upper right corner of the page.

  5. In the Component Library panel's left-side navigation pane, select Input. Then, locate the MongoDB component in the input widget list on the right and drag it onto the canvas.

  6. To configure the MongoDB input widget, click the image icon on the widget card, which opens the MongoDB Input Configuration dialog box.

  7. Configure the necessary parameters in the MongoDB Input Configuration dialog box.

    Parameter

    Description

    Step Name

    Fill in the name according to the current widget's scenario. The naming convention is as follows:

    • Can only contain Chinese characters, letters, underscores (_), and numbers.

    • Cannot exceed 64 characters.

    Datasource

    The data source drop-down list displays all MongoDB-type data sources in the current Dataphin, including data sources for which you have read-through permission and those for which you do not. Click the image icon to copy the current data source name.

    • For data sources without read-through permission, you can click Request after the data source to request read-through permission. For more information, see Request Data Source Permission.

    • If you do not have a MongoDB-type data source, you can click Create Data Source in the drop-down list to create a data source. For more information, see Create a MongoDB Data Source.

    Table

    You can enter table name keywords to search or enter the exact table name and click Exact Search. After selecting a table, the system will automatically perform table status detection. Click the image icon to copy the name of the currently selected table.

    Input Filter (optional)

    Fill in the filter information for input fields. You need to fill in the filter statement supported by MongoDB. This is optional. For example, data where age is greater than 23 {"age":{"$gt":23}}.

    Convert Document And Array To JSON Format

    The default selection is Yes, and the system will convert Document and Array formats to JSON format for output. If you select No, the original format will be retained.

    Output Fields

    Displays the output fields for you. You can perform the following operations to manually add output fields:

    • Batch Add Output Fields.

      • Click Batch Add to support batch configuration in JSON format or Text format.

        Note

        After batch addition is completed, clicking confirm will overwrite the configured field information.

        • JSON Format:

          // Example:
          [{
            "name": "Chinese",
            "type": "string"
           },
           {
            "name": "sid",
            "type": "string"
           },
           {
            "name": "user_id",
            "type": "string"
           }]
        • TEXT Format:

          // Example:
          Chinese,string
          sid,string
          user_id,string
    • Create New Output Field: Click +create New Output Field and fill in Column and select Type according to the page prompts. After completing the configuration for the current row, click the image icon to save.

    • Manage Output Fields: You can perform the following operations on the added fields.

      • Click the Actions column agag icon to edit the existing fields.

      • Click the Actions column's agfag icon to delete the existing fields.

  8. To finalize the property configuration for the MongoDB Input Widget, click Confirm.