收藏
回答

按查询按升序排列,为什么提示错误?

 const db = wx.cloud.database()
 db.collection('tt').orderby('time','asc').where({           //此地需要写orderby??
    time: 20//可为变量


  })
    .get()
    .then(res => {
      console.log(res);


     })
提示:VM212:1 thirdScriptError
db.collection(...).orderby is not a function;at "pages/page/index" page lifeCycleMethod onLoad function
TypeError: db.collection(...).orderby is not a function
    at Ue.onLoad (http://127.0.0.1:17063/appservice/pages/yd%20page/index.js:231:25)
    at Ue.<anonymous> (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:1928503)
    at Ue.p.__callPageLifeTime__ (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:1928248)
    at jt (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:1944068)
    at Mt (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:1946017)
    at Function.<anonymous> (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:1956428)
    at i.<anonymous> (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:1919155)
    at i.emit (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:621502)
    at Object.emit (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:588082)
    at i.<anonymous> (http://127.0.0.1:17063/appservice/__dev__/WAService.js:2:679270)


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签