I'm trying to combine two firestore queries in an Ionic/Angular project using RxJS. I found this blog post from which explains the basic principle, however, the .combineLatest method has been deprecated and I can't figure out how to pipe the two queries into a map instead.
caOrCoCities$: Observable<City[]>;
...
const californiaRef = this.angularFirestore
.collection("cities", ref => ref.where("state","==","CA"));
const coloradoRef = this.angularFirestore
.collection("cities", ref => ref.where("state","==","CO"));
Not sure how to update this below...
this.caOrCoCities$ = Observable
.combineLatest(californiaRef.valueChanges(),
coloradoRef.valueChanges())
.switchMap(cities => {
const [californiaCities, coloradoCities] = cities;
const combined = californiaCities.concat(coloradoCities);
return Observable.of(combined);
});