我是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)