?
db.removeAll
Delete every row matching a predicate, in one DELETE. Returns the count.
Table.removeAll(predicate, bindings?) → Mutation<number>
Deletes every row matching the predicate and returns how many were removed. With bindings, it compiles to a single DELETE WHERE. Without them, it falls back to fetching rows and deleting by id, so lift outer-scope values into bindings on any table that can grow.
Parameters
predicate
(row, $) => boolean
RequiredRows matching this are deleted.
bindings
object
Lift outer-scope values so it compiles to a single DELETE.
Delete by condition
const n = await Sessions.removeAll( (s, $) => s.expiresAt < $.now, { now: Date.now() }, // bindings: single DELETE WHERE );