MongoDB compatibility
Silt is an embedded MongoDB alternative: @silt-db/mongodb runs a MongoDB-compatible JavaScript API in your application process, with SQLite providing storage and query execution. Supported application code can reuse its collection operations, filters, pipelines, and updates after changing the import and initialization. Silt is prerelease; check the limits below against the code you intend to run.
For API usage and query syntax, use the official MongoDB Node driver documentation. Silt's references describe supported operations and differences:
Limits to check first
Unsupported syntax normally throws SILT_UNSUPPORTED, SILT_VALIDATION, or a driver compatibility error. Document-dependent invalid values abort execution in SQLite and can surface as malformed JSON. There is no JavaScript query fallback.
Execution and storage differences
Mongo API insertMany, bulkWrite, and updateMany preserve earlier successful writes outside a transaction when a later write fails. A failing batch inside an explicit transaction rolls back that transaction. The lower-level core API keeps insertMany and updateMany atomic across the operation. Mongo API updateMany currently retains candidate IDs in O(matches) JavaScript memory; filtering and update transformations run in SQL.
Mongo and core APIs share ordinary document collections and indexes. dropDatabase() removes those collections while preserving the SQLite file, ShareDB snapshot/operation tables, and custom SQL/BLOB tables. ShareDB provides its own operation/subscription integration and requires shared PubSub for notifications across backend processes.
Portable cursors page SQLite TEMP results; server cursors lease WAL readers. Rows are decoded lazily, while toArray() collects all remaining results in JavaScript. SQLite may materialize intermediate results. Compound-value sorting can require O(n²) ranking, and unindexed correlated lookups can scan the foreign collection for every local row. SQLite parser, nesting, and resource limits apply.
Owned server files default to WAL and full synchronous durability; borrowed connections retain caller configuration. Tested Expo browser persistence uses OPFS with DELETE journaling. Node and Expo web execution have validation evidence; native Expo device runtime execution remains a separate, uncompleted gate.
Compatibility evidence
MongoDB is the semantic authority. Existing hosted CI results cover exercised query, pipeline, update, driver API, and transaction comparisons against MongoDB 8.0.29 and 8.3.8; captured fixtures retain their recorded provenance. These results establish the tested cases, not complete MongoDB parity. See testing and actual results for versions, reproduction, and validation scope.