This gem runs in .
Overview
This page describes how to configure MongoDB Source and Target gems, including connection setup, schema options, and available write modes. Use the MongoDB Source or Target gem to read from or write to MongoDB collections within your pipeline.Create a MongoDB gem
To create a MongoDB Source or Target gem in your pipeline:1
Add a Source or Target gem to the pipeline
- Open your pipeline in the Studio.
- Click on Source/Target in the canvas.
- Select Source or Target from the dropdown.
- Click on the gem to open the configuration.
2
Select MongoDB format
In the Type tab, select MongoDB. Then, click Next.
3
Set location details
In the Location tab, set your connection details and collection location. To learn more, jump to Source location and Target location.
4
Set table properties
In the Properties tab, set the table properties. To learn more, jump to Source
properties and Target properties.
5
Preview data (Source only)
In the Preview tab, load a sample of the data and verify that it looks correct.
Source configuration
Use these settings to configure a MongoDB Source gem for reading data from a collection.Source location
| Parameter | Description |
|---|---|
| Format type | Table format for the target. For MongoDB, set to mongodb. |
| Select or create connection | Select or create a new MongoDB connection in the Prophecy fabric you will use. |
| Database | Database containing the table you want to read from. |
| Name | Name of the MongoDB table to read. |
Source properties
| Property | Description | Default |
|---|---|---|
| Description | Description of the table. | None |
| No. of docs to consider for Schema inference | Number of documents to sample from the collection to infer the schema. | None |
Target configuration
Use these settings to configure a MongoDB Target gem for writing data to a collection.Target location
| Parameter | Description |
|---|---|
| Format type | Table format for the target. For MongoDB, set to mongodb. |
| Select or create connection | Select or create a new MongoDB connection in the Prophecy fabric you will use. |
| Database | Database where the target table will be created or updated. |
| Name | Name of the MongoDB table to write data to. If the table doesn’t exist, it will be created automatically. |
Target properties
| Property | Description | Default |
|---|---|---|
| Description | Description of the table. | None |
| Write Mode | Whether to overwrite the table, append new data to the table, or throw an error if the table exists. | None |

