Documentdb is a MongoDB-compatible document database built on PostgreSQL, adding BSON data types and Mongo-style APIs via a gateway translation layer. It supports CRUD plus advanced workloads like full-text, geospatial, and vector search while staying MIT-licensed.
Components (core extension, public API, gateway) let teams keep Postgres operations while presenting a Mongo API surface. Docker images and Python/pymongo examples make local development easy without proprietary licensing.
Use Cases:
DocumentDB is a MongoDB compatible open source document database built on PostgreSQL. It offers a native implementation of a document-oriented NoSQL database, enabling seamless CRUD (Create, Read, Update, Delete) operations on BSON(Binary JSON) data types within a PostgreSQL framework. Beyond basic operations, DocumentDB empowers users to execute complex workloads, including full-text searches, geospatial queries, and vector search, delivering robust functionality and flexibility for diverse data management needs.
PostgreSQL (https://www.postgresql.org/about/) is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads.
The project comprises of three components, which work together to support document operations.
At DocumentDB, we believe in the power of open-source to drive innovation and collaboration. Our commitment to being a fully open-source MongoDB compatible document database means that we are dedicated to transparency, community involvement, and continuous improvement. We are open-sourced under the most permissive MIT (https://opensource.org/license/mit) license, where developers and organizations alike have no restrictions incorporating the project into new and existing solutions of their own. DocumentDB introduces the BSON data type to PostgreSQL and provides APIs for seamless operation within native PostgreSQL, enhancing efficiency and aligning with operational advantages.
DocumentDB also provides a powerful on-premise solution, allowing organizations to maintain full control over their data and infrastructure. This flexibility ensures that you can deploy it in your own environment, meeting your specific security, compliance, and performance requirements. With DocumentDB, you get the best of both worlds: the innovation of open-source and the control of on-premise deployment.
We chose PostgreSQL as our platform for several reasons:
Building From Source
Step 1: Install Python
pip install pymongo
Step 2. Install optional dependencies
pip install dnspython
Step 3. Setup DocumentDB using Docker
# Pull the latest DocumentDB Docker image
docker pull ghcr.io/documentdb/documentdb/documentdb-local:latest
# Tag the image for convenience
docker tag ghcr.io/documentdb/documentdb/documentdb-local:latest documentdb
# Run the container with your chosen username and password
docker run -dt -p 10260:10260 --name documentdb-container documentdb --username --password
docker image rm -f ghcr.io/documentdb/documentdb/documentdb-local:latest || echo "No existing documentdb image to remove"
Note: Replace
andwith your desired credentials. You must set these when creating the container for authentication to work.Port Note: Port
10260is used by default in these instructions to avoid conflicts with other local database services. You can use port27017(the standard MongoDB port) or any other available port if you prefer. If you do, be sure to update the port number in both yourdocker runcommand and your connection string accordingly.
Step 4: Initialize the pymongo client with the credentials from the previous step
import pymongo
from pymongo import MongoClient
# Create a MongoDB client and open a connection to DocumentDB
client = pymongo.MongoClient(
'mongodb://:@localhost:10260/?tls=true&tlsAllowInvalidCertificates=true'
)
Step 5: Create a database and collection
quickStartDatabase = client["quickStartDatabase"]
quickStartCollection = quickStartDatabase.create_collection("quickStartCollection")
Step 6: Insert documents
# Insert a single document
quickStartCollection.insert_one({
'name': 'John Doe',
'email': '[email protected]',
'address': '123 Main St, Anytown, USA',
'phone': '555-1234'
})
# Insert multiple documents
quickStartCollection.insert_many([
{
'name': 'Jane Smith',
'email': '[email protected]',
'address': '456 Elm St, Othertown, USA',
'phone': '555-5678'
},
{
'name': 'Alice Johnson',
'email': '[email protected]',
'address': '789 Oak St, Sometown, USA',
'phone': '555-8765'
}
])
Step 7: Read documents
# Read all documents
for document in quickStartCollection.find():
print(document)
# Read a specific document
singleDocumentReadResult = quickStartCollection.find_one({'name': 'John Doe'})
print(singleDocumentReadResult)
Step 8: Run aggregation pipeline operation
pipeline = [
{'$match': {'name': 'Alice Johnson'}},
{'$project': {
'_id': 0,
'name': 1,
'email': 1
}}
]
results = quickStartCollection.aggregate(pipeline)
print("Aggregation results:")
for eachDocument in results:
print(eachDocument)
5MB Rust OpenAI-compatible server for local GGUF/SafeTensors models with hot swaps, auto-discovery, and optional GPU/MOE offloading for drop-in use across tools and SDKs.
Tiny Rust OpenAI-compatible server for local GGUF/SafeTensors models with hot swaps, auto-discovery, and multi-backend GPU/MOE support for drop-in use across editors and SDKs.
803KB pure-C Windows timer with clock/countdown/Pomodoro modes, animated tray icons, transparent always-on-top UI, and portable winget install.
AI agent context platform with natural role switching, MCP-based tool integration, and desktop/Docker deployments for Claude/Cursor and other AI apps.
Official Eden emulator release mirror providing multi-arch Debian/Ubuntu packages and RC builds with direct download links and community support references.
Local GUI and WebUI for multi-agent AI (Gemini/Claude/Codex/Qwen), with MCP tool management, remote access, persistent chats, and bundled file/image/Excel helpers.