I have my firebase structure like this…
There are number of keys like this .
I am displaying my data like this in a table-
How can I use firebase query to search and fetch the details according to train name,Arrival time ,like this.
Any help in this regard would be appreciated…
My .ts file code-
showdata()
{
this.searchtrainno().on('value', snapshot => {
this.trainList = [];
snapshot.forEach( snap => {
this.trainList.push({
id: snap.key,
Arrivaltime:snap.val().Arrivaltime,
Departuretime:snap.val().Departuretime,
DestinationStationName:snap.val().DestinationStationName,
DestinationstationCode:snap.val().DestinationstationCode,
Distance:snap.val().Distance,
islno:snap.val().islno,
sourceStationName:snap.val().sourceStationName,
SourceStationCode:snap.val().SourceStationCode,
StationName:snap.val().StationName,
stationCode:snap.val().stationCode,
trainName:snap.val().trainName,
TrainNo:snap.val().TrainNo
});
return false
});
});
}
searchtrainno()
{
console.log( this.userProfileRef.orderByValue().startAt('00851').endAt('00851'));
return this.userProfileRef.orderByValue().startAt('00851').endAt('00851');
}
I am not getting any output on running this,and
On console.log I am getting value-
X {u: Qg, path: E, m: lf, Nc: true}
Nc
:
true
m
:
lf {xa: false, ka: true, Kb: false, na: true, Rb: false, …}
path
:
E {o: Array(0), Y: 0}
u
:
Qg {app: FirebaseAppImpl, L: zb, Va: Lf, Vc: null, ca: Ye, …}
ref
:
(…)
proto
:
Object