云开发怎么按照数组的某一项排序呢?
是排行榜的需求,数据长这样
[
{name:"q", week:[{index:19, number:2},{index:20,number:4}]},
{name:"w", week:[{index:19, number:2},{index:20,number:3}]},
{name:"e", week:[{index:19, number:2},{index:20,number:5}]}
]
比如这周是第20周,我就要找到week里index为20的,然后根据index为20的number来从大到小排序,这个应该怎么写呢?