I am using Objection.js ORM of Node.js. I want to use whereIn with raw
Here is what I am trying -
var bookingData = await DoctorBookingsModel
.query()
.select('b.id as booking_id','b.appointment_date')
.from('doctor_bookings as b')
.whereIn(raw("DATE(b.appointment_date) = '"+arrUnavailbleDates+"'"))
.first();
But I am getting following error -
Error: Undefined binding(s) detected when compiling SELECT query: select `b`.`id` as `booking_id`, `b`.`appointment_date` from `doctor_bookings` as `b` where DATE(b.appointment_date) = '2020-10-16,2020-10-17' in ?
Please help me.
Any help would be appreciated,
Thanks.
requires 2 arguments. Looks like you were maybe trying to write:
a bit like this runkit example https://runkit.com/embed/qm1rwz9dff2h