'''js
db.collection('opendb-news-articles').where({
"category_id": "62d766c0f6d1400001566da8"
}).field('timestampToDate(publish_date) as date').orderBy('publish_date','desc').limit(50).get();
'''
![花间一壶酒](https://img-cdn-tc.dcloud.net.cn/account/identicon/1f03869c3c61aa2bd7f603958f3e489e.png)
花间一壶酒
- 发布:2022-12-09 10:45
- 更新:2022-12-09 11:33
- 阅读:244
产品分类: uniCloud/App
示例代码:
操作步骤:
collection opendb-news-article
collection opendb-news-article
预期结果:
返回结果正确排序
返回结果正确排序
实际结果:
乱序
乱序
花间一壶酒 (作者)
'''
db.collection('opendb-news-articles').where({
"category_id": "62d766c0f6d1400001566da8"
}).field('timestampToDate(publish_date) as date').orderBy('publish_date desc').limit(50).get();
'''js
两种写法, 结果一样
2022-12-09 11:37
DCloud_uniCloud_WYQ
回复 花间一壶酒: field里面as之后应该按照as后的字段排序
2022-12-09 11:39
花间一壶酒 (作者)
回复 DCloud_uniCloud_WYQ: 可以了, 谢谢您
2022-12-09 12:01