Skip to content

Commit e425fcd

Browse files
Merge pull request #308676 from Lucky-Wang16/1124-Update_mongodb_query
[Doc Update] Remove MongoDB aggregate query
2 parents c136d0d + 54c470c commit e425fcd

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

articles/data-factory/connector-mongodb.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: jianleishen
66
ms.author: jianleishen
77
ms.subservice: data-movement
88
ms.topic: conceptual
9-
ms.date: 06/30/2025
9+
ms.date: 01/26/2026
1010
ms.custom:
1111
- synapse
1212
- sfi-image-nochange
@@ -275,23 +275,12 @@ The following table shows the release stage and change logs for different versio
275275

276276
| Version | Release stage | Change log |
277277
| :------- | :---------------------- |:---------- |
278-
| MongoDB (legacy) | End of support | / |
278+
| MongoDB (legacy) | Removed | Not applicable. |
279279
| MongoDB | GA version available | • Support the equivalent MongoDB queries only. <br><br>• Double is read as String data type. |
280280

281281
### Upgrade the MongoDB linked service
282282

283-
Here are steps that help you upgrade your linked service and related queries:
284-
285-
1. Create a new MongoDB linked service and configure it by referring to [Linked service properties](#linked-service-properties).
286-
1. If you use SQL queries in your pipelines that refer to the old MongoDB linked service, replace them with the equivalent MongoDB queries. See the following table for the replacement examples:
287-
288-
| SQL query | Equivalent MongoDB query |
289-
|:--- |:--- |
290-
| `SELECT * FROM users` | `db.users.find({})` |
291-
| `SELECT username, age FROM users` |`db.users.find({}, {username: 1, age: 1})` |
292-
| `SELECT username AS User, age AS Age, statusNumber AS Status, CASE WHEN Status = 0 THEN "Pending" CASE WHEN Status = 1 THEN "Finished" ELSE "Unknown" END AS statusEnum LastUpdatedTime + interval '2' hour AS NewLastUpdatedTime FROM users` | `db.users.aggregate([{ $project: { _id: 0, User: "$username", Age: "$age", Status: "$statusNumber", statusEnum: { $switch: { branches: [ { case: { $eq: ["$Status", 0] }, then: "Pending" }, { case: { $eq: ["$Status", 1] }, then: "Finished" } ], default: "Unknown" } }, NewLastUpdatedTime: { $add: ["$LastUpdatedTime", 2 * 60 * 60 * 1000] } } }])`|
293-
| `SELECT employees.name, departments.name AS department_name FROM employees LEFT JOIN departments ON employees.department_id = departments.id;`|`db.employees.aggregate([ { $lookup: { from: "departments", localField: "department_id", foreignField: "_id", as: "department" } }, { $unwind: "$department" }, { $project: { _id: 0, name: 1, department_name: "$department.name" } } ])` |
294-
283+
Create a new MongoDB linked service and configure it by referring to [Linked service properties](#linked-service-properties).
295284

296285
## Related content
297286
For a list of data stores supported as sources and sinks by the copy activity, see [supported data stores](copy-activity-overview.md#supported-data-stores-and-formats).

0 commit comments

Comments
 (0)