I have a user table with a data jsonb column. In that, I have a cars array that can have 0-N cars in it.
I'm trying to do a query like this to find if the user's cars array contains either Toyota or Mitsubishi, but it's throwing an error
await knex('users.record')
.where('created_at', '>', '2019-05-21')
.select('data')
.whereRaw('cars', ['Toyota', 'Mitsubishi']) // this seems wrong
.returning('*');
One example user's cars array is ['Toyota', 'Mitsubishi', 'Honda', 'Ford']