Prerequisites
When you create a MongoDB connection in Prophecy, access permissions are tied to the credentials you use. This is because Prophecy uses your credentials to execute all data operations, such as reading from or writing to collections. To fully leverage a MongoDB connection in Prophecy, you need the following MongoDB permissions:Readfrom the collection defined in the connectionWriteto the collection defined in the connection
Feature support
The table below outlines whether the connection supports certain Prophecy features.| Feature | Supported |
|---|---|
| Read data with a Source gem | Yes |
| Write data with a Target gem | Yes |
| Browse data in the Environment browser | Yes |
| Index tables in the Knowledge Graph | No |
Connection parameters
To create a connection with MongoDB, enter the following parameters:| Parameter | Description |
|---|---|
| Connection Name | Name to identify your connection |
| Protocol | Protocol to use to communicate to the database Example: mongodb+srv for cloud-hosted clusters |
| Host | Where your MongoDB instance runs Example: cluster0.<cluster-name>.mongodb.net for cloud-hosted clusters |
| Username | Username for your MongoDB instance |
| Password (Secret required) | Password for your MongoDB instance |
| Database | Default database for reading and writing data |
| Collection | Collection to use for the connection |
Data type mapping
When Prophecy processes data from MongoDB using SQL warehouses, it converts MongoDB-specific data types to formats compatible with your target warehouse. This table shows how MongoDB data types are transformed for Databricks and BigQuery.| MongoDB | Databricks | BigQuery |
|---|---|---|
| 32-bit integer | INT Alias: Integer | INT64 Alias: Integer |
| 64-bit integer | BIGINT Alias: Bigint | INT64 Alias: Integer |
| Double | DOUBLE Alias: Double | FLOAT64 Alias: Float |
| Boolean | BOOLEAN Alias: Boolean | BOOL Alias: Boolean |
| String | STRING Alias: String | STRING Alias: String |
| Date | TIMESTAMP Alias: Timestamp | TIMESTAMP Alias: Timestamp |
| Timestamp | TIMESTAMP Alias: Timestamp | TIMESTAMP Alias: Timestamp |
| Binary | BINARY Alias: Binary | BYTES Alias: Bytes |
| ObjectId | STRING Alias: String | STRING Alias: String |
| Decimal128 | DECIMAL(34,2) Alias: Decimal | BIGNUMERIC(34, 2) Alias: Numeric |
| Min key | STRING Alias: String | STRING Alias: String |
| Max key | STRING Alias: String | STRING Alias: String |
| Regular Expression | STRING Alias: String | STRING Alias: String |
| DBPointer | STRING Alias: String | STRING Alias: String |
| JavaScript | STRING Alias: String | STRING Alias: String |
| JavaScript with scope | STRING Alias: String | STRING Alias: String |
| Symbol | STRING Alias: String | STRING Alias: String |
| Embedded Document | STRUCT Alias: Struct | STRUCT Alias: Struct |
| Array | ARRAY Alias: Array | ARRAY Alias: Array |
| Empty Array | ARRAY Alias: Array | ARRAY Alias: Array |
| Null | STRING Alias: String | STRING Alias: String |
| Unidentified | STRING Alias: String | STRING Alias: String |
Learn more in Supported data types.

