Controlled absence
required:true is appropriate when a missing resource must not look like a successful deletion.
SERVER / DATABASE / WRITE
Delete
Delete removes records that match a declared equality filter and returns a result binding with the change count.
Transactions
REMOVE
Delete with an ownership filter
Use a static table and include every server-owned equality field required to authorize the deletion. required:true makes an empty match a controlled 404.
handler deleteBlog req
db db name:"content"
query deleted db:db.delete table:"blogs" where:{ id:req.params.id ownerId:req.context.auth.subject } required:true
return response json:{ ok:true changed:deleted.changed }Controlled absence
required:true is appropriate when a missing resource must not look like a successful deletion.
Explicit result
The query binding carries the change result; return only the fields your endpoint contract needs.