Skip to main content

MongoDB

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.

Configuration tabs

When you create a new external Source or Target gem, the gem dialog contains the following tabs.

  • Type: Select the MongoDB table option.
  • Source/Target location: Choose the connection and define the location where you will read/write tables in MongoDB.
  • Properties: Infer or manually specify the schema, and optionally add properties that influence table behavior.
  • Preview: Load a preview of the dataset reflecting your configurations.

The following sections provide a detailed reference for sources and targets.

Source configuration

Use these settings to configure a MongoDB Source gem for reading data from a collection.

Source location

ParameterDescription
Format typeTable format for the target. For MongoDB, set to mongodb.
Select or create connectionSelect or create a new MongoDB connection in the Prophecy fabric you will use.
DatabaseDatabase containing the table you want to read from.
NameName of the MongoDB table to read.

Source properties

PropertyDescriptionDefault
DescriptionDescription of the table.None
No. of docs to consider for Schema inferenceNumber 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

ParameterDescription
Format typeTable format for the target. For MongoDB, set to mongodb.
Select or create connectionSelect or create a new MongoDB connection in the Prophecy fabric you will use.
DatabaseDatabase where the target table will be created or updated.
NameName of the MongoDB table to write data to. If the table doesn’t exist, it will be created automatically.

Target properties

PropertyDescriptionDefault
DescriptionDescription of the table.None
Write ModeWhether to overwrite the table, append new data to the table, or throw an error if the table exists.None