AngularFireList filter by specific child key name

22 Views Asked by At

I have an object called Payments which have multiple house objects represented by their id.

Each house have their monthly payment objects, like the picture below:

enter image description here

With the function below, I get all the payments.

getPaymentsByMonthYear(monthYear: string): AngularFireList<IMonthlyPayments> {
   return this.db.list('/payments');
}

But I wish to filter and return only the inner objects called 012024

Following the documentation https://firebase.google.com/docs/database/web/lists-of-data?hl=pt-br#listen_for_child_events, I tried to query like below, without any success.

getPaymentsByMonthYear(monthYear: string): AngularFireList<IMonthlyPayments> {
  return this.db.list('/payments', (q) => q.orderByChild(monthYear).equalTo(monthYear));
}

Any ideas of how to do this?

0

There are 0 best solutions below