目前使用这一结构来询问所有项目:
const filteredItems = await allItems.findAll({
where: conditions,
include: associations,
order: sortingCriteria,
limit: limit,
offset: offset,
});
The sortingCriteria
currently has this structure:
const sortingCriteria = [
["price", "ASC NULLS LAST"],
["created_at", "DESC NULLS LAST"],
]
∗∗∗∗ <代码>所有项目代码>表。 在同一张表格中,还有另一个领域,即<代码>details,有
此外,我需要补充一种分类标准,因此,我用在JSONB中的一些具体数据来排列,这一结构是: Let s say I want to order by 使用JSONB而不是设置表格和JOIN是个原因。 我已经尝试过,而且每张桌上就座,业绩大大提高。 用于主食目的,请见<条码> 限值/代码>和<条码>。 I mdetails = {
"sizes": {
"height": 10,
"width": 20,
},
"capacities": {
"volume": 200,
"weight": 2,
}
}
volume
all the items (and also by price
and created_at
, as I already have). How should I include that in sortingCriteria
?