如上代码
- 发布:2023-03-31 09:56
- 更新:2023-04-03 17:48
- 阅读:176
产品分类: uniCloud/腾讯云
操作步骤:
预期结果:
正常运行
正常运行
实际结果:
云对象报错,放在客户端死掉
云对象报错,放在客户端死掉
bug描述:
对uni-id-users username字段查重
云对象
getUserRepetitionData: async function() {
const db = uniCloud.databaseForJQL({ // 获取JQL database引用,此处需要传入云对象的clientInfo
clientInfo: this.getClientInfo()
})
const dbUser = db.collection('uni-id-users')
let repetitionData = dbUser.groupBy('username').groupField('sum(1) as num').getTemp();
let res = await db.collection(repetitionData).get();
console.log(res)
return res;
}
运行let res = await db.collection(repetitionData).get();报错:
09:50:10.230 [本地调试]Error: L.split is not a function
09:50:10.239 [本地调试] at processTicksAndRejections (node:internal/process/task_queues:96:5)
09:50:10.243 [本地调试] at async ce.getUserRepetitionData
放在客户端运行,
const db = uniCloud.databaseForJQL
const dbUser = db.collection('uni-id-users')
let repetitionData = dbUser.groupBy('username').groupField('sum(1) as num').getTemp();
let res = await db.collection(repetitionData).get();
运行let res = await db.collection(repetitionData).get();不报错,但死掉
1 个回复
DCloud_uniCloud_WYQ
collection方法内只有联表才能这样传参