whereNot
The whereNot method finds all records that do not match the provided clauses.
await User.whereNot({
email: ops.ilike('burpcollaborator.net'),
}).all()
Chaining
You can chain multiple whereNot calls together, as well as chain them with other calls to where. This is useful for conditional query building:
let query = Post.whereNot({ name: null })
if (this.params.body) {
query = query.whereNot({ body: null })
}
await query.all()