Everything you expect,
nothing you don't.
Built in Rust on Tokio. Full MongoDB wire protocol with a SQLite engine โ no replica sets, no cluster orchestration, no ops burden.
Full CRUD
insertOne, insertMany, find, findOne, updateOne/Many, deleteOne/Many, findAndModify, count, distinct, bulk writes โ all supported.
Aggregation Pipeline
$match, $sort, $group (all accumulators), $lookup, $unwind, $project, $facet, $out, $addFields, $sample, $replaceRoot, $sortByCount, $unset, $replaceWith, $count, $regexMatch, and 40+ expression operators. All accumulators and expressions are type-safe โ Int32/Int64/Double handled correctly.
Index Management
Create single, compound, and unique indexes. List, drop, and index-backed query execution โ all through standard MongoDB commands.
Auth & Authorization
SCRAM-SHA-256 and SCRAM-SHA-1 authentication. Role-based access control with root, readWrite, and read roles. User management via createUser, updateUser, dropUser.
TLS Encryption
Built-in TLS support via rustls (pure Rust, no OpenSSL). Enable with --tls flag. Generate self-signed certs with make tls-certs or bring your own CA-signed certs. All wire protocol traffic encrypted.
SQLite Backend
Every database is a single SQLite file. WAL mode, synchronous NORMAL, foreign keys โ fast, reliable, zero-config persistence with no daemon tuning.
Wire Protocol Parity
OP_MSG, OP_QUERY, OP_GET_MORE, OP_KILL_CURSORS, document sequences, checksum parsing โ maxWireVersion 21 (MongoDB 8.0+).
Tool Compatible
Works with mongosh, mongodump, mongorestore, pymongo (with note), and any MongoDB driver speaking OP_MSG. Drop-in, zero migration.
DB & Collection Ops
createCollection, drop, dropDatabase, listDatabases, listCollections, collStats, dbStats โ full database and collection lifecycle management.
Low-Resource Devices
Runs on as little as 32 MB RAM and a single core. Ideal for Raspberry Pi, edge gateways, VPS micro-instances, and embedded Linux โ a full MongoDB-compatible server at a fraction of the cost.
Works with your existing tools.
Zero-config drop-in โ point your application at d4m and go.
mongosh
mongodump
mongorestore
pymongo 4.x
MongoDB Drivers
SCRAM-SHA-256
โ ๏ธ pymongo 4.17+ C-level encoder strips $-prefixed keys in arrays; use mongosh or raw BSON for aggregates. All other operations work.
๐ง Note on type safety: The bson crate's accessor methods match exact types only (Int32(5).as_i64() returns None). d4m uses type-safe helpers throughout the aggregation engine โ all numeric operators, accumulators, and $regex handle Int32, Int64, and Double correctly.