如何在firebase中使用带有或条件的两个where子句

时间:2019-11-03 09:50:12

标签: javascript firebase google-cloud-firestore

我是Firebase的新手,请帮助我解决此问题


    getChats(callback){ db.collection('chat') .onSnapshot(snapshot=>{
        (snapshot.docChanges()).forEach(data=>{
            if(data.type=='added'){
                callback(data.doc.data());
            }
        }) }) }

响应:

{body: "send me your user_name", from: "admin1", time: so, to: "keshav"}
{body: "admin i forget my password can ", from: "keshav", time: so, to: "admin"}
{body: "hii", "from ": "admin", time: so, to: "keshav"}
{body: "Hello admin how are you ", "from ": "keshav", time: so, to: "admin"}

现在我想获取同时满足两个条件的数据 条件:-

  

其中(from = admin和to = keshav)或(from = keshav和to = admin)

0 个答案:

没有答案