Integrates DuckDB with MongoDB, enabling direct SQL queries over MongoDB collections without exporting data or ETL
Maintainer(s):
stephaniewang526
Installing and Loading
INSTALL mongo FROM community;
LOAD mongo;
Example
-- Load the extension
LOAD 'mongo';
-- Connect to MongoDB and query collections
SELECT * FROM mongo_scan('mongodb://localhost:27017', 'mydb', 'mycollection');
-- Use MongoDB Atlas connection string
SELECT * FROM mongo_scan('mongodb+srv://user:[email protected]/dbname', 'mydb', 'mycollection');
-- Attach MongoDB as a database
ATTACH 'mongodb://localhost:27017' AS mongo_db (TYPE mongo);
USE mongo_db;
SELECT * FROM mycollection;
About mongo
The duckdb-mongo extension provides direct SQL access to MongoDB collections without requiring data export or ETL processes. It supports both standalone MongoDB instances and MongoDB Atlas clusters, with automatic schema inference and filter pushdown for efficient querying. The extension enables you to run analytical SQL queries directly against MongoDB data, including joins, aggregations, and complex analytical operations.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| mongo_clear_cache | table | NULL | NULL | |
| mongo_scan | table | NULL | NULL |