db.collection('kehu').where({
user_id:uniCloud.getCurrentUserInfo().uid
}).field('dateToString(create_date, "%Y-%m-%d") as yearMonthDayUTC').get().then(res=>{
console.log(res);
})
报错如图,这样都能报错,是为什么?'can't convert from BSON type long to Date'
看不懂的UBT (作者)
阿里云的。
2025-04-07 20:45
DCloud_uniCloud_CRL
回复 看不懂的UBT: 你数据库中保存是时间戳吗?
2025-04-10 11:05
看不懂的UBT (作者)
回复 DCloud_uniCloud_CRL: 是时间戳啊。也试过转换一下,也不行,还是报这个错误
2025-04-11 11:20
DCloud_uniCloud_CRL
回复 看不懂的UBT: dateToString 应该传的是Date,不是时间戳。
2025-04-18 14:32