Skip to content

Commit c288962

Browse files
Merge pull request #302016 from Lucky-Wang16/0630-Update_Mongodb_datatype
Add MongoDB data type mapping section
2 parents 6bdc06b + af77d17 commit c288962

2 files changed

Lines changed: 50 additions & 19 deletions

File tree

articles/data-factory/connector-mongodb-legacy.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,26 @@ When copying data from MongoDB, the following mappings are used from MongoDB dat
193193

194194
| MongoDB data type | Interim service data type |
195195
|:--- |:--- |
196-
| Binary |Byte[] |
197-
| Boolean |Boolean |
198-
| Date |DateTime |
199-
| NumberDouble |Double |
200-
| NumberInt |Int32 |
201-
| NumberLong |Int64 |
202-
| ObjectID |String |
203-
| String |String |
204-
| UUID |Guid |
205-
| Object |Renormalized into flatten columns with “_" as nested separator |
196+
| Date | Int64 |
197+
| ObjectId | String |
198+
| Decimal128 | String |
199+
| TimeStamp | The most significant 32 bits -> Int64<br>The least significant 32 bits -> Int64 |
200+
| String | String |
201+
| Double | Double |
202+
| Int32 | Int64 |
203+
| Int64 | Int64 |
204+
| Boolean | Boolean |
205+
| Null | Null |
206+
| JavaScript | String |
207+
| Regular Expression | String |
208+
| Min key | Int64 |
209+
| Max key | Int64 |
210+
| Binary | String |
206211

207212
> [!NOTE]
208213
> To learn about support for arrays using virtual tables, refer to [Support for complex types using virtual tables](#support-for-complex-types-using-virtual-tables) section.
209214
>
210-
> Currently, the following MongoDB data types are not supported: DBPointer, JavaScript, Max/Min key, Regular Expression, Symbol, Timestamp, Undefined.
215+
> Currently, the following MongoDB data types aren't supported: DBPointer, Symbol, Undefined.
211216
212217
## Support for complex types using virtual tables
213218

articles/data-factory/connector-mongodb.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: jianleishen
77
ms.subservice: data-movement
88
ms.topic: conceptual
99
ms.custom: synapse
10-
ms.date: 05/15/2024
10+
ms.date: 06/30/2025
1111
---
1212

1313
# Copy data from or to MongoDB using Azure Data Factory or Synapse Analytics
@@ -200,7 +200,7 @@ The following properties are supported in the Copy Activity **sink** section:
200200
| writeBatchTimeout | The wait time for the batch insert operation to finish before it times out. The allowed value is timespan. | No<br/>(the default is **00:30:00** - 30 minutes) |
201201

202202
>[!TIP]
203-
>To import JSON documents as-is, refer to [Import or export JSON documents](#import-and-export-json-documents) section; to copy from tabular-shaped data, refer to [Schema mapping](#schema-mapping).
203+
>To import JSON documents as-is, refer to [Import or export JSON documents](#import-and-export-json-documents) section; to copy from tabular-shaped data, refer to [Schema mapping](#data-type-mapping-for-mongodb).
204204
205205
**Example**
206206

@@ -244,12 +244,38 @@ You can use this MongoDB connector to easily:
244244

245245
To achieve such schema-agnostic copy, skip the "structure" (also called *schema*) section in dataset and schema mapping in copy activity.
246246

247-
248-
## Schema mapping
249-
250-
To copy data from MongoDB to tabular sink or reversed, refer to [schema mapping](copy-activity-schema-and-type-mapping.md#schema-mapping).
251-
252-
## Upgrade the MongoDB linked service
247+
## Data type mapping for MongoDB
248+
249+
When copying data from MongoDB, the following mappings are used from MongoDB data types to interim data types used by the service internally. See [Schema and data type mappings](copy-activity-schema-and-type-mapping.md) to learn about how copy activity maps the source schema and data type to the sink.
250+
251+
| MongoDB data Type | Interim Service Data Type |
252+
|:---|:---|
253+
| Date | Int64 |
254+
| ObjectId | String |
255+
| Decimal128 | String |
256+
| TimeStamp | The most significant 32 bits -> Int64<br>The least significant 32 bits -> Int64 |
257+
| String | String |
258+
| Double | String |
259+
| Int32 | Int64 |
260+
| Int64 | Int64 |
261+
| Boolean | Boolean |
262+
| Null | Null |
263+
| JavaScript | String |
264+
| Regular Expression | String |
265+
| Min key | Int64 |
266+
| Max key | Int64 |
267+
| Binary | String |
268+
269+
## MongoDB connector lifecycle and upgrade
270+
271+
The following table shows the release stage and change logs for different versions of the MongoDB connector:
272+
273+
| Version | Release stage | Change log |
274+
| :------- | :---------------------- |:---------- |
275+
| MongoDB (legacy) | End of support | / |
276+
| MongoDB | GA version available | • Support the equivalent MongoDB queries only. <br><br>• Double is read as String data type. |
277+
278+
### Upgrade the MongoDB linked service
253279

254280
Here are steps that help you upgrade your linked service and related queries:
255281

0 commit comments

Comments
 (0)