雲開發數據庫匹配之 and 和 or 的配合使用
代碼:
// 獲取成員消息
onMsg2() {
let that = this
wx.cloud.init({
env: 'gezi-ofhmx'
})
const DB = wx.cloud.database()
const _ = DB.command;
var aa = "1"
var bb = "2"
DB.collection('message_logging').where(_.and([{
a: _.eq(aa).or(_.eq(bb))
},
{
b: _.eq(aa).or(_.eq(bb))
}
])).get()
.then(res => {
console.log('-------', res)
})
},