Compatibility contract
Silt is a MongoDB-shaped JSON document database implemented over SQLite, currently an alpha. It is not wire-compatible with MongoDB, a complete MongoDB server, a fully compatible BSON store, or a complete implementation of every Mingo operator. Unsupported syntax normally throws SILT_UNSUPPORTED or SILT_VALIDATION; document-dependent invalid values abort execution in SQLite. There is no JavaScript query fallback.
MongoDB semantics are the target; the initial research examined MongoDB 8.3.8. Executable conformance evidence in the captured validation run is against MongoDB 8.0.29. See test methodology and actual results.
Data and API
Queries
Field order matters for embedded-object equality. Missing/null matches and array traversal follow measured Mongo cases, including behaviors where Mingo differs. A SQL comparison helper has a captured 900-pair real-Mongo ordering corpus. That is substantial evidence, not an exhaustive proof over all JSON trees.
Aggregation
20 stage names and 18 accumulator names are implemented. See the detailed aggregation matrix for operand restrictions and costs.
Arrays/objects can be ordered accurately in SQL, but some paths use O(n²) ranking. Eligible equality and correlated-equality lookups use indexed probes. Other correlated lookups can scan the foreign relation once per local row. These are current performance limitations, not JS fallback behavior.
Expressions and updates
Expression documentation lists arithmetic, trigonometry, conditionals, scoped variables, array/map/filter/reduce, sets, objects, strings, conversion and optional native regex operators. Conversion targets and ranges are explicit. Numeric $type is rejected because JSON does not preserve BSON subtype metadata. Long conversion is restricted to safe JS integers. Date/timezone and Decimal128 semantics remain absent. Some operations involving embedded NUL strings deliberately reject inputs; other documented NUL-related limits remain.
Update documentation covers $set, $unset, $inc, $mul, $min, $max, $rename, $setOnInsert, $push, $addToSet, $pop, $pull, $pullAll, $bit, update pipelines, numeric array paths and $[]/$[identifier] filters. Legacy positional $, $currentDate, and potentially overlapping positional paths are rejected. The narrow Mongo modifiedCount difference for removing/restoring _id in an update pipeline is documented.
ShareDB
The persistent adapter passes ShareDB's official DB harness, with additional integration cases for reopen persistence, atomic op/snapshot commits, tombstones, metadata, casing and live foreign lookup dependencies. See adapter documentation.
It preserves sharedb-mingo-memory's high-level query conventions, including $aggregate results in query extra. ShareDB itself applies OT and projections to fetched snapshots. Multiple backend processes need shared PubSub to distribute live notifications. Those protocol behaviors are distinct from SQL document selection/aggregation.
Work toward broader compatibility
- Validate against newer MongoDB releases and capture changed semantics; the original test environment could not initialize MongoDB 8.3.8.
- Keep the initial contract pure JSON; extended BSON types are intentionally deferred.
- Expand proven optimizer rewrites and multikey bound combinations, with exact indexed/unindexed and Mongo differential tests; benchmark representative subscription workloads.
- Introduce a typed SQL IR and common-subexpression reuse to reduce expensive generated SQL and replace quadratic compound sorting where possible.
- Implement remaining window, graph, statistical and write stages, each with full Mongo oracle cases and explicit resource handling.
- Broaden applicable upstream fixture imports and match Mingo's measured coverage across the expanded feature surface. Current coverage figures and passing unsupported-rejection cases must not be presented as full operator parity.