Use this handler in a POST route with a validated email parameter.
async function handler(state) {
var { email } = state.req.body.params
var result = await state.plugins.mongodb
.collection('users').deleteOne({ email })
return state.jarpc({ ok: true, deleted: result.deletedCount })
}
deleteOne() removes at most one matching document.
Next: Static files →