云数据库查询时where条件,没有起作用?

发布于 8 年前作者 minqin3137 次浏览最后编辑 8 年前来自 ask

  return new Promise(function(resolvereject) {

    const db = wx.cloud.database()

    // 查询指定openid的用户

    db.collection(‘user’).where({

      // _openid: openid

      _openid: ‘0’ // 无论此处为何值都能查到数据

    }).get().then(res => {

      if(res.data.length === 1) {

        console.log(‘find’,res.data)

        resolve(res)

      }

      else {

        console.log(‘not find’)

      }

    }).catch(err => {

      reject(err)

    })

1 回复
lmeng
lmeng1 楼6 年前

猜当仅所有者可读时,_openid会被替换成用户的openid