const db = uniCloud.database();
db.collection('xxx').where({
user_id: "xxx"
}).orderBy("rank_score desc").limit(1).get()
- 发布:2023-06-10 17:01
- 更新:2023-07-10 12:05
- 阅读:390
产品分类: uniCloud/App
示例代码:
操作步骤:
const db = uniCloud.database();
db.collection('xxx').where({
user_id: "xxx"
}).orderBy("rank_score desc").limit(1).get()
const db = uniCloud.database();
db.collection('xxx').where({
user_id: "xxx"
}).orderBy("rank_score desc").limit(1).get()
预期结果:
[
{
"_id": "xxx",
"create_time": "2023-06-07 00:54:21",
"xx": xxx,
"xxx": xx,
"xx": 1,
"xx": "xx",
"x": 92
}
]
[
{
"_id": "xxx",
"create_time": "2023-06-07 00:54:21",
"xx": xxx,
"xxx": xx,
"xx": 1,
"xx": "xx",
"x": 92
}
]
实际结果:
Error: 排序字符不合法
at Function.isFieldOrder (/tmp/function/@dcloudio/serverless/lib/aliyun/uni-cloud.js:1:10922)
at It.orderBy (/tmp/function/@dcloudio/serverless/lib/aliyun/uni-cloud.js:1:41420)
at i.reload_rank (/tmp/function/index.obj.js:742:7)
at <anonymous>
Error: 排序字符不合法
at Function.isFieldOrder (/tmp/function/@dcloudio/serverless/lib/aliyun/uni-cloud.js:1:10922)
at It.orderBy (/tmp/function/@dcloudio/serverless/lib/aliyun/uni-cloud.js:1:41420)
at i.reload_rank (/tmp/function/index.obj.js:742:7)
at <anonymous>
2***@qq.com
解决了问题,官方文档垃圾
2023-07-19 16:37