You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** MongoDB requires a replica set or sharded cluster for transaction support. Standalone MongoDB servers do not support ACID transactions at the server level.
536
537
538
+
## SQL to MongoDB Mapping
539
+
540
+
The table below shows how PyMongoSQL translates SQL operations into MongoDB commands.
|`items[0].name`|`items.0.name`| Array index access |
596
+
597
+
### DML Mapping Details
598
+
599
+
| SQL DML | MongoDB Behavior | Notes |
600
+
|---|---|---|
601
+
|`INSERT INTO col VALUE {...}`| Single document insert | PartiQL object literal |
602
+
|`INSERT INTO col VALUE << {...}, {...} >>`| Multi-document insert | PartiQL bag syntax |
603
+
|`INSERT INTO col (c1, c2) VALUES (v1, v2)`| Columns and values zipped into document | Standard SQL syntax |
604
+
|`UPDATE col SET f1 = v1`|`{$set: {f1: v1}}` with `multi: true`| Updates all matching docs |
605
+
|`DELETE FROM col`|`{q: {}, limit: 0}`| Deletes all documents |
606
+
|`DELETE FROM col WHERE ...`|`{q: filter, limit: 0}`| Deletes all matching docs |
607
+
608
+
> **Note:** All operations (except `aggregate`) use `db.command()` — the low-level MongoDB wire protocol commands — rather than PyMongo's higher-level helpers like `collection.find()` or `collection.insert_many()`. This enables transaction session support and unified retry handling.
609
+
537
610
## Apache Superset Integration
538
611
539
612
PyMongoSQL can be used as a database driver in Apache Superset for querying and visualizing MongoDB data:
0 commit comments