I need to search my database, which is the "FLOOR KEY" which is "main".
The data I have is as follows:
this._userID = ALIANSCE
this._mapID = MAP NAME THAT HAS BEEN CLICKED ON MARKER OF GOOGLE MAPS
What I do not have is the name of "FLOOR" that I need to find from according to what I said above.
I get the following notification in the console:
util.js: 189 FIREBASE WARNING: Using an unspecified index. Your date will be downloaded and filtered on the client. Consider adding ".indexOn": "floorType" at / users / Aliansce / MAPS / ViaParqueShopping / FLOORS / B30 to your security rules for better performance.
My code is as follows:
static AsyncQueryMainFloorMap(mapID){
const GOOGLE_MAPS_STATIC_CLASS = GoogleMaps;
this._userID = "Aliansce";
this._mapID = mapID;
this._mapFloorROOT = this.FirebaseInstance.ref('users/' + this._userID + '/MAPS/' + this._mapID).child('FLOORS');
this._mapFloorROOT.once('child_added').then((mapFloorSnapshot) => {
this._floorROOT = this.FirebaseInstance.ref('users/' + this._userID + '/MAPS/' + this._mapID + '/FLOORS/').child('' + mapFloorSnapshot.key + '/');
this._floorROOT.orderByChild('floorType').equalTo('main').once('child_added').then((e) => {
console.log(e.key)
});
}) .catch((error) => {
console.warn("error: " + error);
// TODO
});
};