首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >小程序云开发,如何使用where.方式请求数据?

小程序云开发,如何使用where.方式请求数据?

提问于 2018-11-05 13:21:43
回答 1关注 0查看 4K

想通过where.方式读取符合(1._openid  2.num  )两个条件的数据(location),但读取不成功。反而通过doc.('_id')能读取,但就无法筛选符合条件的数据了。

希望能提供通过where.读取的成功方法,谢谢!

代码如下:

const db = wx.cloud.database();

db.collection('mi_cloud').where({

_openid: 'o8o - G5FENEXj_huKcZlp - Rvb9acg',

num: 1

})

.get({

success: function (res) {

// res.data 包含该记录的数据

console.log(res.data)

that.setData({

location: res.data.location

})

}

})

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档