A PostgreSQL foreign data wrapper that enables querying and manipulating MongoDB data directly from PostgreSQL.
MongoDB Foreign Data Wrapper (mongo_fdw) is a PostgreSQL extension that allows PostgreSQL to query and manipulate MongoDB data as if it were native PostgreSQL tables. It solves the problem of integrating document-based NoSQL data with relational SQL queries, enabling seamless cross-database operations without data migration.
Database administrators and developers working in environments that use both PostgreSQL and MongoDB, who need to perform unified queries or data integration between the two systems.
Developers choose mongo_fdw for its performance optimizations like query push-down and connection pooling, its write capabilities, and its ability to leverage PostgreSQL's powerful SQL features on MongoDB data without custom ETL pipelines.
PostgreSQL foreign data wrapper for MongoDB
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports pushing JOIN, AGGREGATE, ORDER BY, and LIMIT OFFSET operations to MongoDB, reducing network traffic and leveraging remote server performance, as detailed in the features section.
Allows INSERT, UPDATE, and DELETE on MongoDB collections via PostgreSQL SQL commands, overcoming the previous read-only limitation for full data manipulation.
Reuses MongoDB connections within a PostgreSQL session, improving performance by avoiding new connections per query, as highlighted in the enhancements.
Offers GUC variables and table options to control push-down behavior, allowing fine-tuning for specific queries or tables.
Cannot use IMPORT FOREIGN SCHEMA due to MongoDB's schemaless nature, requiring manual foreign table creation for each collection.
Only supports specific join types (INNER/OUTER) and aggregate functions (min, max, sum, avg, count), with filters, distinct, and full outer joins not pushed down.
Requires double-quoted column names for BSON keys with uppercase letters or nested documents, and is constrained by PostgreSQL's 63-character column name limit.
Does not implement the TRUNCATE API, limiting efficient bulk deletion operations due to MongoDB's schemaless design.