MongoDB is a NoSQL database designed to store and retrieve unstructured or semi-structured data using BSON documents.Documentation Index
Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
Use this file to discover all available pages before exploring further.
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, BigQuery, and Snowflake.| MongoDB | Databricks | BigQuery | Snowflake |
|---|---|---|---|
| 32-bit integer | intAlias: Integer | int64Alias: Integer | numberAlias: Number |
| 64-bit integer | bigintAlias: Bigint | int64Alias: Integer | numberAlias: Number |
| Double | doubleAlias: Double | float64Alias: Float | floatAlias: Float |
| Boolean | booleanAlias: Boolean | boolAlias: Boolean | booleanAlias: Boolean |
| String | stringAlias: String | stringAlias: String | stringAlias: String |
| Date | timestampAlias: Timestamp | timestampAlias: Timestamp | timestampAlias: Timestamp |
| Timestamp | timestampAlias: Timestamp | timestampAlias: Timestamp | timestampAlias: Timestamp |
| Binary | binaryAlias: Binary | bytesAlias: Bytes | binaryAlias: Binary |
| ObjectId | stringAlias: String | stringAlias: String | stringAlias: String |
| Decimal128 | decimal(34,2)Alias: Decimal | bignumeric(34,2)Alias: Numeric | number(34,2)Alias: Number |
| Min key | stringAlias: String | stringAlias: String | stringAlias: String |
| Max key | stringAlias: String | stringAlias: String | stringAlias: String |
| Regular Expression | stringAlias: String | stringAlias: String | stringAlias: String |
| DBPointer | stringAlias: String | stringAlias: String | stringAlias: String |
| JavaScript | stringAlias: String | stringAlias: String | stringAlias: String |
| JavaScript with scope | stringAlias: String | stringAlias: String | stringAlias: String |
| Symbol | stringAlias: String | stringAlias: String | stringAlias: String |
| Embedded Document | structAlias: Struct | structAlias: Struct | variantAlias: Variant |
| Array | arrayAlias: Array | arrayAlias: Array | arrayAlias: Array |
| Empty Array | arrayAlias: Array | arrayAlias: Array | arrayAlias: Array |
| Null | stringAlias: String | stringAlias: String | stringAlias: String |
| Unidentified | stringAlias: String | stringAlias: String | stringAlias: String |
Embedded MongoDB documents are inferred as Snowflake
VARIANT values when read through the Spark MongoDB connector. Although Snowflake supports the OBJECT type, inferred embedded documents map to VARIANT unless explicitly declared otherwise.Learn more in Supported data types.

