官网:https://knexjs.org/
其他:https://blog.csdn.net/liuyueyi1995/article/details/53782047
笔记
1.knex.raw 处理特殊字段,根据 json 类型某个值进行排序
// training_area : {"city_id": 1, "area_id": 2}
//select * from reservation order by training_area::Json ->> 'city_id' asc
knex('reservation').select('training_area').orderBy(knex.raw("training_area::json ->> 'city_id'"), 'desc')
.then(data => console.log(data))