Is it possible to do multiple orderBy() columns?
knex .select() .table(\'products\') .orderBy(\'id\', \'asc\')
The orderBy() chainable on
You can use the following solution to solve your problem:
const builder = knex.table('products'); sortArray.forEach( ({ field, direction }) => builder.orderBy(field, direction) );