documentdb
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
documentdb | 0.113 | SIM | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9000 | documentdb | No | Yes | Yes | Yes | No | No | - |
| 9010 | documentdb_core | No | Yes | Yes | Yes | No | No | - |
| 9020 | documentdb_distributed | No | Yes | Yes | Yes | No | No | - |
| 9030 | documentdb_extended_rum | No | Yes | Yes | Yes | No | Yes | - |
| Related | documentdb_core pg_cron postgis tsm_system_rows vector mongo_fdw wal2mongo pg_jsonschema jsquery |
|---|---|
| Depended By | documentdb_distributed documentdb_extended_rum |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.113 | 1817161514 | documentdb | documentdb_core, pg_cron, postgis, tsm_system_rows, vector |
| RPM | PIGSTY | 0.113 | 1817161514 | documentdb_$v | postgresql$v-contrib, pg_cron_$v, pgvector_$v, rum_$v, postgis36_$v |
| DEB | PIGSTY | 0.113 | 1817161514 | postgresql-$v-documentdb | postgresql-$v-cron, postgresql-$v-pgvector, postgresql-$v-rum, postgresql-$v-postgis-3 |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.113 el8.x86_64.pg18 : documentdb_18 documentdb_18-0.113-0PIGSTY.el8.x86_64.rpm
| PIGSTY 0.113 el8.x86_64.pg17 : documentdb_17 documentdb_17-0.113-0PIGSTY.el8.x86_64.rpm
| PIGSTY 0.113 el8.x86_64.pg16 : documentdb_16 documentdb_16-0.113-0PIGSTY.el8.x86_64.rpm
| PIGSTY 0.113 el8.x86_64.pg15 : documentdb_15 documentdb_15-0.113-0PIGSTY.el8.x86_64.rpm
| PIGSTY MISS |
| el8.aarch64 | PIGSTY 0.113 el8.aarch64.pg18 : documentdb_18 documentdb_18-0.113-0PIGSTY.el8.aarch64.rpm
| PIGSTY 0.113 el8.aarch64.pg17 : documentdb_17 documentdb_17-0.113-0PIGSTY.el8.aarch64.rpm
| PIGSTY 0.113 el8.aarch64.pg16 : documentdb_16 documentdb_16-0.113-0PIGSTY.el8.aarch64.rpm
| PIGSTY 0.113 el8.aarch64.pg15 : documentdb_15 documentdb_15-0.113-0PIGSTY.el8.aarch64.rpm
| PIGSTY MISS |
| el9.x86_64 | PIGSTY 0.113 el9.x86_64.pg18 : documentdb_18 documentdb_18-0.113-0PIGSTY.el9.x86_64.rpm
| PIGSTY 0.113 el9.x86_64.pg17 : documentdb_17 documentdb_17-0.113-0PIGSTY.el9.x86_64.rpm
| PIGSTY 0.113 el9.x86_64.pg16 : documentdb_16 documentdb_16-0.113-0PIGSTY.el9.x86_64.rpm
| PIGSTY 0.113 el9.x86_64.pg15 : documentdb_15 documentdb_15-0.113-0PIGSTY.el9.x86_64.rpm
| PIGSTY MISS |
| el9.aarch64 | PIGSTY 0.113 el9.aarch64.pg18 : documentdb_18 documentdb_18-0.113-0PIGSTY.el9.aarch64.rpm
| PIGSTY 0.113 el9.aarch64.pg17 : documentdb_17 documentdb_17-0.113-0PIGSTY.el9.aarch64.rpm
| PIGSTY 0.113 el9.aarch64.pg16 : documentdb_16 documentdb_16-0.113-0PIGSTY.el9.aarch64.rpm
| PIGSTY 0.113 el9.aarch64.pg15 : documentdb_15 documentdb_15-0.113-0PIGSTY.el9.aarch64.rpm
| PIGSTY MISS |
| el10.x86_64 | PIGSTY 0.113 el10.x86_64.pg18 : documentdb_18 documentdb_18-0.113-0PIGSTY.el10.x86_64.rpm
| PIGSTY 0.113 el10.x86_64.pg17 : documentdb_17 documentdb_17-0.113-0PIGSTY.el10.x86_64.rpm
| PIGSTY 0.113 el10.x86_64.pg16 : documentdb_16 documentdb_16-0.113-0PIGSTY.el10.x86_64.rpm
| PIGSTY 0.113 el10.x86_64.pg15 : documentdb_15 documentdb_15-0.113-0PIGSTY.el10.x86_64.rpm
| PIGSTY MISS |
| el10.aarch64 | PIGSTY 0.113 el10.aarch64.pg18 : documentdb_18 documentdb_18-0.113-0PIGSTY.el10.aarch64.rpm
| PIGSTY 0.113 el10.aarch64.pg17 : documentdb_17 documentdb_17-0.113-0PIGSTY.el10.aarch64.rpm
| PIGSTY 0.113 el10.aarch64.pg16 : documentdb_16 documentdb_16-0.113-0PIGSTY.el10.aarch64.rpm
| PIGSTY 0.113 el10.aarch64.pg15 : documentdb_15 documentdb_15-0.113-0PIGSTY.el10.aarch64.rpm
| PIGSTY MISS |
| d12.x86_64 | PIGSTY 0.113 d12.x86_64.pg18 : postgresql-18-documentdb postgresql-18-documentdb_0.113-0PIGSTY~bookworm_amd64.deb
| PIGSTY 0.113 d12.x86_64.pg17 : postgresql-17-documentdb postgresql-17-documentdb_0.113-0PIGSTY~bookworm_amd64.deb
| PIGSTY 0.113 d12.x86_64.pg16 : postgresql-16-documentdb postgresql-16-documentdb_0.113-0PIGSTY~bookworm_amd64.deb
| PIGSTY 0.113 d12.x86_64.pg15 : postgresql-15-documentdb postgresql-15-documentdb_0.113-0PIGSTY~bookworm_amd64.deb
| PIGSTY MISS |
| d12.aarch64 | PIGSTY 0.113 d12.aarch64.pg18 : postgresql-18-documentdb postgresql-18-documentdb_0.113-0PIGSTY~bookworm_arm64.deb
| PIGSTY 0.113 d12.aarch64.pg17 : postgresql-17-documentdb postgresql-17-documentdb_0.113-0PIGSTY~bookworm_arm64.deb
| PIGSTY 0.113 d12.aarch64.pg16 : postgresql-16-documentdb postgresql-16-documentdb_0.113-0PIGSTY~bookworm_arm64.deb
| PIGSTY 0.113 d12.aarch64.pg15 : postgresql-15-documentdb postgresql-15-documentdb_0.113-0PIGSTY~bookworm_arm64.deb
| PIGSTY MISS |
| d13.x86_64 | PGDG 0.113 | PGDG 0.113 | PGDG 0.113 | PGDG 0.113 | PIGSTY MISS |
| d13.aarch64 | PGDG 0.113 | PGDG 0.113 | PGDG 0.113 | PGDG 0.113 | PIGSTY MISS |
| u22.x86_64 | PIGSTY 0.113 u22.x86_64.pg18 : postgresql-18-documentdb postgresql-18-documentdb_0.113-0PIGSTY~jammy_amd64.deb
| PIGSTY 0.113 u22.x86_64.pg17 : postgresql-17-documentdb postgresql-17-documentdb_0.113-0PIGSTY~jammy_amd64.deb
| PIGSTY 0.113 u22.x86_64.pg16 : postgresql-16-documentdb postgresql-16-documentdb_0.113-0PIGSTY~jammy_amd64.deb
| PIGSTY 0.113 u22.x86_64.pg15 : postgresql-15-documentdb postgresql-15-documentdb_0.113-0PIGSTY~jammy_amd64.deb
| PIGSTY MISS |
| u22.aarch64 | PIGSTY 0.113 u22.aarch64.pg18 : postgresql-18-documentdb postgresql-18-documentdb_0.113-0PIGSTY~jammy_arm64.deb
| PIGSTY 0.113 u22.aarch64.pg17 : postgresql-17-documentdb postgresql-17-documentdb_0.113-0PIGSTY~jammy_arm64.deb
| PIGSTY 0.113 u22.aarch64.pg16 : postgresql-16-documentdb postgresql-16-documentdb_0.113-0PIGSTY~jammy_arm64.deb
| PIGSTY 0.113 u22.aarch64.pg15 : postgresql-15-documentdb postgresql-15-documentdb_0.113-0PIGSTY~jammy_arm64.deb
| PIGSTY MISS |
| u24.x86_64 | PIGSTY 0.113 u24.x86_64.pg18 : postgresql-18-documentdb postgresql-18-documentdb_0.113-0PIGSTY~noble_amd64.deb
| PIGSTY 0.113 u24.x86_64.pg17 : postgresql-17-documentdb postgresql-17-documentdb_0.113-0PIGSTY~noble_amd64.deb
| PIGSTY 0.113 u24.x86_64.pg16 : postgresql-16-documentdb postgresql-16-documentdb_0.113-0PIGSTY~noble_amd64.deb
| PIGSTY 0.113 u24.x86_64.pg15 : postgresql-15-documentdb postgresql-15-documentdb_0.113-0PIGSTY~noble_amd64.deb
| PIGSTY MISS |
| u24.aarch64 | PIGSTY 0.113 u24.aarch64.pg18 : postgresql-18-documentdb postgresql-18-documentdb_0.113-0PIGSTY~noble_arm64.deb
| PIGSTY 0.113 u24.aarch64.pg17 : postgresql-17-documentdb postgresql-17-documentdb_0.113-0PIGSTY~noble_arm64.deb
| PIGSTY 0.113 u24.aarch64.pg16 : postgresql-16-documentdb postgresql-16-documentdb_0.113-0PIGSTY~noble_arm64.deb
| PIGSTY 0.113 u24.aarch64.pg15 : postgresql-15-documentdb postgresql-15-documentdb_0.113-0PIGSTY~noble_arm64.deb
| PIGSTY MISS |
| u26.x86_64 | PIGSTY MISS | ||||
| u26.aarch64 | PIGSTY MISS |
Build
You can build the RPM / DEB packages for documentdb using pig build:
pig build pkg documentdb # build RPM / DEB packages
Install
You can install documentdb directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install documentdb; # Install for current active PG version
pig ext install -y documentdb -v 18 # PG 18
pig ext install -y documentdb -v 17 # PG 17
pig ext install -y documentdb -v 16 # PG 16
pig ext install -y documentdb -v 15 # PG 15
dnf install -y documentdb_18 # PG 18
dnf install -y documentdb_17 # PG 17
dnf install -y documentdb_16 # PG 16
dnf install -y documentdb_15 # PG 15
apt install -y postgresql-18-documentdb # PG 18
apt install -y postgresql-17-documentdb # PG 17
apt install -y postgresql-16-documentdb # PG 16
apt install -y postgresql-15-documentdb # PG 15
Preload:
shared_preload_libraries = 'pg_documentdb, pg_documentdb_core, pg_cron';
Create Extension:
CREATE EXTENSION documentdb CASCADE; -- requires: documentdb_core, pg_cron, postgis, tsm_system_rows, vector
Usage
Sources: README, CHANGELOG, documentdb.control, documentdb_core.control, documentdb_extended_rum.control
documentdb is a MongoDB-compatible document database implemented as PostgreSQL extensions. It adds BSON storage and APIs in PostgreSQL, plus an optional gateway layer for MongoDB wire-protocol clients. FerretDB 2.0+ can use DocumentDB as its backend.
Components
The public extension surface is split across related extensions:
documentdb_core: BSON datatype and low-level BSON operations.documentdb: public API for document CRUD and query behavior.documentdb_extended_rum: extended RUM access method used by DocumentDB indexing.pg_documentdb_gw: gateway protocol layer used by the local Docker image and MongoDB-compatible clients.
Install the SQL extension in each database that needs the API:
CREATE EXTENSION IF NOT EXISTS documentdb CASCADE;
The documentdb.control file for 0.113-0 declares dependencies on documentdb_core, pg_cron, tsm_system_rows, vector, and postgis. The gateway container listens on a MongoDB-compatible port; the README examples use 10260 to avoid colliding with local MongoDB services.
MongoDB Client Example
import pymongo
client = pymongo.MongoClient(
"mongodb://user:pass@localhost:10260/?tls=true&tlsAllowInvalidCertificates=true"
)
db = client["quickStartDatabase"]
coll = db.create_collection("quickStartCollection")
coll.insert_one({"name": "Alice", "email": "alice@example.com"})
print(coll.find_one({"name": "Alice"}))
The upstream README also demonstrates aggregation pipelines through normal MongoDB drivers:
pipeline = [
{"$match": {"name": "Alice"}},
{"$project": {"_id": 0, "name": 1, "email": 1}},
]
for doc in coll.aggregate(pipeline):
print(doc)
Version Notes
This project’s CSV tracks DocumentDB 0.113 for PostgreSQL 15-18. The upstream tag is v0.113-0; control files report default_version = '0.113-0'.
The 0.111 through 0.113 changelog entries are mostly query-planner, collation, and index correctness work:
0.113-0adds opt-in collation support for non-unique ordered indexes with$inand$nin, and supports pruning dead index entries on ordered TTL indexes behind feature flags.0.112-0removes the legacy composite-returningbson_update_documentUDF path, expands non-unique ordered-index collation support, and improves$groupand accumulator execution.0.111-0adds background init job infrastructure, more$groupvalidation, collation/index pushdown improvements, and several crash fixes.
Caveats
- DocumentDB is a multi-extension stack;
CREATE EXTENSION documentdb CASCADEis the normal entry point, but operational deployments also need the gateway/runtime pieces if MongoDB wire compatibility is required. - Some features listed in the changelog are gated by
documentdb.*feature flags. Verify flag defaults in the exact installed build before documenting behavior as always-on. documentdb_extended_rumis relocatable, butdocumentdbanddocumentdb_coreare not.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.