AND-OR conditions in firebase query Javascript -


couldn't found answers on google docs neither on stack, have ask this.

how hit query or condition in firebase servers.

basically, want check if specific chat conversation exist in database. chat can have 2 types of ids (steveandjacob or jacobandsteve), how can check if either 1 of them exist in db?

here code 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 done?


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -