大家好,问一个云开发数据库记录排序问题,按日期排序?
发布于 5 年前 作者 rzhu 13612 次浏览 来自 问答

小程序开发前,把日期定义成了string类型了,已经有部分数据了,现在用的

return db.collection(dbname).where(

filter

).skip((pageindex - 1) * pagesize).limit(pagesize).orderBy('isopen', 'asc').orderBy('date', 'desc').get().then(


res => {

res.hasmore = hasmore,

res.pagetotal = pagetotal

return res


})

}

请问 ,能否通过修改,orderby中date字段字符串类型转成date类型吗,怎么转换呢?

谢谢。

回到顶部