Skip to content

Instantly share code, notes, and snippets.

@shangyilim
Last active January 15, 2019 11:49
Show Gist options
  • Save shangyilim/10eeca2a321ef7d7fe9f11382469ffab to your computer and use it in GitHub Desktop.
Save shangyilim/10eeca2a321ef7d7fe9f11382469ffab to your computer and use it in GitHub Desktop.
import { collection } from 'rxfire/firestore';
import { map } from 'rxjs/operators';
// Query for California
var californiaRef = citiesRef.where("state", "==", "CA");
// Query for Colorado
var coloradoRef = citiesRef.where("state", "==", "CO");
// Create Observables ready for subscribe().
var california$ = collection(californiaRef)
.pipe(map(cities => cities.map(c => c.data())));
var colorado$ = collection(coloradoRef)
.pipe(map(cities => cities.map(c => c.data())));;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment