I have a list of instances in my Firebase database, and I want to filter the list if and only if the the user chooses to filter the query. If the user doesn't choose to filter the query I just want to output all instances
What I am trying to do.
var ref = new Firebase("myfirebaseurl");
if(condition){
var query = ref.orderByChild("somechild").equalTo("conditionchosen");
} else {
var query = ref.orderByChild("somechild").equalTo(any value);
}
Any way to do this?