Answers for "whereIn knex"

0

whereIn knex

const myArray = [1,2,3]
knex.raw('select * from users where id in (' + myArray.map(_ => '?').join(',') + ')', [...myArray]);
// query will become: select * from users where id in (?, ?, ?) with bindings [1,2,3]
Posted by: Guest on June-17-2021

Browse Popular Code Answers by Language