Couldn't found any answers on google docs neither on stack, So I have to ask this.
How do I hit a query with OR condition in it to firebase servers.
Basically, I want to check if Specific chat conversation already exist in the database. Chat can have two types of IDs (steveandjacob OR jacobandsteve), how can I check if either one of them exist in DB?
Here is some code I have wrote.
var currentUserID = localstorage.getItem('currentUserID');
var chatid = currentUserID+''+anotherUserID;
var chatid2 = anotherUserID+''+currentUserID;
var ref = firebase.database().ref('messages/conv').orderByChild('chatid').equalTo(chatid);
ref.on('value', function(snapshot) {
if (snapshot.exists())
alert ("exist");
else
alert ("not exist");
});
How it could be done?