Features/Data
DATA · STABLE

Collections in the user's database, live in every tab.

Schema-less collections of JSON documents, created the first time you use them. Query, insert, update, subscribe. Every document sits in the database of the user who owns it, never in a table of yours.

NO SCHEMA Collections of JSON documents Like tables, without migrations. A collection appears the first time you use it. Add a TypeScript type if you want one.
QUERIES Filters, sorting, pages Equality, ranges, lists, and/or/not, nested fields. Order by any field and page through the results.
REALTIME Subscribe and stay in sync A subscription gets every add, change and delete, for a whole collection, a filter or one document.

Four calls cover most apps.

Insert, update, query, subscribe. A helper keeps a local array in sync, so the UI just renders it.

const tasks = bzr.collection("tasks")
await tasks.insertOne({ name: "Buy milk", done: false })
await tasks.updateOne(id, { done: true })
const open = await tasks.getAll({ done: false })
// keep an array in sync with the collection
await tasks.subscribeAll({}, arrayMirrorSubscribeListener(list))
Server timestamps Write "$now" and the server fills in the UTC time, whatever the user's clock says.
Other owners' data A context opens another user's, an org's or the app's database with the same API. Access needs a grant.
Rides out bad connections A subscription lasts over connection losses and replays what changed meanwhile.

What collections can't do.

Queries across users Each query runs on one owner's database. No global leaderboards or analytics over everyone.
Joins and server logic No joins, triggers or functions. Combine data in the app.
Schema checks The server doesn't check a document's shape. Validate in the app, or narrow writes with a grant's filter.
OTHER WINDOWS