brianc/node-sql

How can I add `NOT` to a condition?

Opened this issue · 1 comments

I'm using postgres and i have an array dataType. I'm trying to find rows where the array does not contain a certain value.

I'm able to do it right now like this:

tickets.where(`NOT ${tickets.skipped_ids.contains(Sql.array(id))}`)

Is there a better way?

I think I got it:

var skipped = tickets.skipped_ids.contains(Sql.array(id))
tickets.where(skipped.equals(false))