服务端http查询db, 使用orderBy报错
发布于 6 年前 作者 cxiong 13081 次浏览 来自 问答

通过接口查询数据:

POST https://api.weixin.qq.com/tcb/databasequery?access_token=ACCESS_TOKEN

请求:

Array
(
    [query] => db.collection('user').where({coin: db.command.gt(150)}).field({_id: true,coin: true,point: true,nickName: true,}).orderBy('coin','desc').orderBy('point','asc').skip(0).limit(10).get()
)

返回:

Array
(
    [errcode] => 0
    [errmsg] => Query sort entered in the request is illegal. Please check your request, but if the problem persists, contact us. hint: [kFMC401202028]
)

移除orderBy之后可以正常返回查询数据,orderBy的字段也在集合中

2 回复

你好,问题已解决,麻烦重试下

mark下,坐等解答

回到顶部