db.some
Resolves to true if any row matches the predicate.
Resolves to true when at least one row matches the predicate. It is a Query, so it batches; lift outer-scope comparisons into bindings. Cheaper than counting when you only need to know something exists.
Parameters
predicate
(row, $) => boolean
RequiredCompiled to a SQL WHERE clause.
bindings
object
Outer-scope values lifted so the check compiles to SQL.
Existence check
const anyPending = await Vendors.some((v) => v.status === 'pending');