s***@126.com
s***@126.com
  • 发布:2024-05-12 15:01
  • 更新:2024-05-12 18:44
  • 阅读:184

云对象中使用$cloudEnv_uid报错

分类:uniCloud
//在云函数中  
    getInitecode:async function(){  
        const db=uniCloud.databaseForJQL({clientInfo:this.getClientInfo()})  
        const id=await this.uniID.checkToken(this.getUniIdToken())  
//1#        const res=await db.collection('uni-id-users').where('_id=="'+id.uid+'"').field('my_invite_code').get()  
//2#        const res=await db.collection('uni-id-user').where('_id==$cloudEnv_uid').field('my_invite_code').get()  
        return res  
    }

如图云函数,
用1#的写法正常,
用2#的写法不正常,
两都就差了这个$cloudEnv_uid
报错如图


也就是说权限没有错,有错的话1应该拿不到数据
错误里的shema也有,本地和云端都有,
有遇到这个问题的吗?

2024-05-12 15:01 负责人:无 分享
已邀请:
s***@126.com

s***@126.com (作者)

已解决,
CTMD,
第二行少写一个字母,
浪费5个小时.

要回复问题请先登录注册