Here is my realtime db structure
myproject
|---------event
|--date1
|--adminid1
|-----hallID1
|--name:"abc"
|--address: "xyz"
|--date2
|--adminid1
|-----hallID2
|--name:"asd"
|--address: "somenadd"
I am trying to an autocomplete search box for name element of my json structure, whenever user enters more than three characters in my search box , I call the search() function which queries firebase db as follows:
scope.search = function(){
firebaseDb
.ref("event")
.orderByChild("name")
.startAt(scope.searchBarModel)
.endAt(scope.searchBarModel + "\uf8ff")
.on("child_added", function(snapshot){
console(snapshot.key);
});
}
However, the above query is not able to find the records in db , what am I doing wrong?
PS: Also same is the case with equalTo query :
scope.search = function(){
firebaseDb
.ref("event")
.orderByChild("name")
.equalTo(scope.searchBarModel)
.on("child_added", function(snapshot){
console(snapshot.key);
});
}