Compatibility
How DocumentDB and the gateway divide MongoDB compatibility, what the packaged extensions support, and what remains untested in Mimus.
This page describes the earlier PG18 stack. DocumentDB and its wire-protocol gateway implement different parts of MongoDB compatibility. The FerretDB and DocumentDB versions below belong to that upstream environment. The 19.0.1-r4 checks used the standalone DocumentDB gateway. Current verification scope
For the authoritative, version-specific command and operator matrices, consult the upstream documentation:
- DocumentDB (
v1.0-0): github.com/documentdb/documentdb - FerretDB (
v2.7.0): docs.ferretdb.io
What each layer covers
| Layer | Component | Compatibility responsibility |
|---|---|---|
| Wire protocol and session handling | FerretDB (2.7.0) or DocumentDB gateway | MongoDB wire framing (OP_MSG), driver handshakes (hello / isMaster), connection pooling, wire-level authentication and translation of client commands into SQL calls |
| BSON storage, operators and indexing | documentdb (1.0-0), documentdb_core, documentdb_extended_rum | BSON binary type (documentdb_core.bson), comparison and numeric rules, collection CRUD, aggregation pipeline execution, RUM path indexing, geospatial (postgis), vector (pgvector) and full-text queries |
Capabilities in the packaged DocumentDB 1.0 stack
Based on the DocumentDB 1.0-0 PostgreSQL packages shipped by PGDG and Pigsty (for PostgreSQL 15–18):
- BSON type and path operations (
documentdb_core): stores documents asdocumentdb_core.bson(withbsonqueryandbsonsequence), provides path extraction (->,->>,bson_get_value,bson_get_value_text), bytea/JSON conversion (bson_from_bytea,bson_to_bytea,bson_json_to_bson,bson_to_json_string), and B-tree and hash operator classes (bson_btree_ops,bson_hash_ops). Comparison, numeric promotion and indexing semantics follow DocumentDB’s BSON implementation rather than PostgreSQLjsonb. - Collection CRUD and aggregation (
documentdb): exposes collection management (documentdb_api.create_collection), document writes (documentdb_api.insert_oneand update/delete functions) and BSON query and aggregation execution (documentdb_api_catalog.bson_aggregation_find). - Indexing (
documentdb_extended_rum): provides an extended RUM index access method tailored for BSON documents and nested paths (documentdb.rum_library_load_option = 'require_documentdb_extended_rum'), including background non-blocking unique index builds (documentdb.enableNonBlockingUniqueIndexBuild, enabled by default sincev0.114) and posting-tree/leaf vacuum pruning in1.0-0. - Geospatial and vector workloads: integrates with
postgisfor geospatial queries andvector(pgvector) for vector similarity search (CREATE EXTENSION documentdb CASCADEinstalls both dependencies).
Known limitations and operational boundaries
- Not identical to every MongoDB server version: DocumentDB
1.0-0and FerretDB do not implement every command, aggregation stage or edge case of every MongoDB release. Applications should test the specific operators, index options, transaction patterns, schema validation rules and driver versions they rely on. - Authentication without MongoDB RBAC:
- In Pigsty’s
mongotemplate, FerretDB enables authentication (FERRETDB_AUTH: true) and checks credentials against PostgreSQL roles, but does not implement MongoDB role-based authorization. MongoDB roles cannot be used to isolate privileges. - In DocumentDB
1.0-0, custom role CRUD and post-join nested$lookupremain disabled by default behind feature flags.
- In Pigsty’s
- Version matching across components:
documentdb,documentdb_coreanddocumentdb_extended_rummust come from the same release line, and release upgrade SQL must be applied when updating existing databases. Because FerretDB releases specify a preferred DocumentDB version, run an authenticated CRUD smoke test after upgrading either FerretDB ordocumentdb. - r4 selects one compatibility protocol per instance. The connections guide documents the single-node DocumentDB gateway and logical restore checks.
