Skip to content

js-bao-wss-client


js-bao-wss-client / DatabaseChangeEvent

Interface: DatabaseChangeEvent<T> ​

A single change delivered on a db.change frame.

The changeType is derived server-side from filter transitions: "enter" (no longer matched → now matches), "update" (matched before and after), "leave" (matched before → no longer matches). Projection-using clients should read changeType; CRDT-aware clients can keep reading op. It is optional because the server only sets it for filter-based subscriptions; non-filter paths omit it.

Type Parameters ​

T ​

T = unknown

Properties ​

changeType? ​

optional changeType?: "update" | "enter" | "leave"


data? ​

optional data?: T | null

The record after the change, or null where the wire carries no new state (a delete, or a mutation that resolved to no fields). A typed caller must account for null in addition to undefined before reading T's fields.


id ​

id: string


modelName ​

modelName: string


op ​

op: "save" | "patch" | "delete" | "increment" | "addToSet" | "removeFromSet"


previousData? ​

optional previousData?: T | null

The record before the change, or null where there was no prior state (an insert / enter). A typed caller must account for null in addition to undefined before reading T's fields.

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30