0
我試圖通過一個工作到目前爲止我的集合獲取結果,但我希望排序是不區分大小寫的。我已經閱讀了書架文檔並在這裏和其他論壇搜索無濟於事。是否需要一些原始的Knex插入?任何幫助深表感謝。書架orderBy忽略大小寫
這裏是我的代碼:
new Recipes().query('orderBy', 'name', 'asc').fetch({
withRelated: [
{ instructions: (query) => { query.orderBy('step_number'); }},
'tags',
'ingredients',
'ingredients.alternatives',
'ingredients.tags'
]
});
我想這樣做:
new Recipes().query('orderByIgnoreCase', 'name', 'asc').fetch({
withRelated: [
{ instructions: (query) => { query.orderBy('step_number'); }},
'tags',
'ingredients',
'ingredients.alternatives',
'ingredients.tags'
]
});
OR:
new Recipes().query('orderBy', LOWER('name'), 'asc').fetch({
withRelated: [
{ instructions: (query) => { query.orderBy('step_number'); }},
'tags',
'ingredients',
'ingredients.alternatives',
'ingredients.tags'
]
});