Skip to content
WeftKitBeta
Modules/WeftKitDoc
MongoDBCouchDB

WeftKitDoc

Document Database

Schema-flexible document database for JSON/BSON documents with secondary indexing, aggregation pipelines, and change streams. MongoDB-compatible query subset.

~3.1 μs

single document insert

BSON StorageULID Document IDsAggregation PipelineChange StreamsMulti-key Indexes
Features

Key Features

What makes WeftKitDoc stand out.

MongoDB-Compatible Query Language

$eq, $gt, $lt, $in, $regex, $exists, $elemMatch, $and, $or, $not. Dot-notation for nested document access.

Aggregation Pipeline

$match, $group, $sort, $limit, $skip, $project, $unwind, $lookup. Optimizer for predicate pushdown and stage fusion.

Secondary Indexes

Single-field, compound, and multi-key indexes on nested paths. Partial and unique indexes with BSON path navigation.

Change Streams

Tailable cursor over WAL for real-time change notification with resume tokens. Compatible with CDC ecosystem component.

Flexible Schema

Documents stored as BSON in B+Tree leaf pages, keyed by 128-bit ULID document IDs. No schema migration required.

BSON Storage Format

Length-prefixed BSON for efficient serialization and querying. Null, string, number, array, object, binary, date, and decimal128 support.

Performance

Performance Targets

Real numbers from Criterion benchmarks on reference hardware.

Document get p99< 50 μs
Indexed query p99< 1 ms
Throughput> 500K ops/sec
Compatibility

Wire Protocol

WeftKitDoc supports the MongoDB Wire Protocol protocol. Your existing tools just work.

mongoshPyMongomotorMongoose
Code Example

Get Started in Seconds

Add WeftKitDoc to your Rust project and start querying.

document.rs
rust
use weftkitdoc::prelude::*;

// Open or create a database
let db = Database::open("my_app.db")?;

// Use the module API
let result = db.query("SELECT * FROM users WHERE active = true")?;

for row in result.rows() {
    println!("{:?}", row);
}
Use Cases

Where to Use It

1

Product catalogs and content management

2

User profiles and preferences

3

Event sourcing and audit logs