StateDBReactive Database for JavaScript
MongoDB-style queries, real-time watchers, schema validation — zero dependencies, ~20KB minified.
MongoDB-style queries, real-time watchers, schema validation — zero dependencies, ~20KB minified.
Familiar query syntax with $gt, $in, $regex, $set, $inc, $push and more. If you know MongoDB, you know StateDB.
Subscribe to insert, update, delete events per collection. Your UI re-renders automatically when data changes.
Type checking, required fields, min/max, enum, regex, defaults, and capped collections — validated on every write.
Single and compound indexes with unique constraints. Queries use the best index automatically — up to 145x faster.
Pre/post middleware for insert, update, delete. Optional auto-save to localStorage or sessionStorage with debounce.
~20KB minified. Ships as ESM, CJS, and IIFE. Works in browsers, Node.js, and any JS runtime. Full TypeScript support.