收藏
回答

请问小程序端调用云函数操作云数据库,如何上传形入_.exists(true)的condition?

云函数端是这样写的
    if(event.type == "get"){
      return await targetDB.where(
        event.condition
      ).get()        
    };

小程序端调用云函数,传入condition

wx.cloud.callFunction({
      name'login',
      data:{
        action:'runDb',
        type:'get', 
        db: 'communist',           
        condition:{
          _id: _.exists(true)
        }},


结果报错:

MiniProgramError
_ is not defined
ReferenceError: _ is not defined
回答关注问题邀请回答
收藏

2 个回答

  • 疯狂的小辣椒
    疯狂的小辣椒
    2020-12-28

    提示非常的明确

    const _ = db.command
    


    2020-12-28
    有用
    回复 2
    • 浩
      2020-12-28
      这部分定义我在云函数里已经定义了,难道在小程序端为了调用云函数 上传这个condition 还要再重新定义一遍?
      2020-12-28
      回复
    • 浩
      2020-12-28
      2020-12-28
      回复
  • 🔥🔥🔥
    🔥🔥🔥
    发表于移动端
    2020-12-27
    ju v xi u f
    2020-12-27
    有用
    回复 1
    • 🔥🔥🔥
      🔥🔥🔥
      发表于移动端
      2020-12-27
      h j j
      2020-12-27
      回复
登录 后发表内容
问题标签