1
votes

I'm trying to filter my FirebaseListObservable:

import 'rxjs/add/operator/filter';
...
jobListRef$: FirebaseListObservable<Job[]>;
...
this.jobListRef$ = this.database.list('job-list',
          { query:
              {
                orderByChild: "state",
                equalTo: "passive"
              }
          }).filter(item => item.employer === this.afAuth.auth.currentUser.uid));

But I get just:

Type 'Observable< any>' is not assignable to type 'FirebaseListObservable< Job[]>'. Property '$ref' is missing in type 'Observable< any>'.

I saw that this issue should be already fixed in angularfire2@^2.0.0-beta.7.1-pre, but I use angularfire2@^4.0.0-rc.2

1
@Sampath I've tried right now, but the problem still exists. - Roman Dorokhov

1 Answers

1
votes

Firstly you need to upgrade to latest. After that:

jobListRef$: Observable<Job[]>;
this.jobListRef$ = this.database.list('job-list', query =>
        {
            return query.orderByChild("state").equalTo("active");
        }
).valueChanges();