Last active
January 15, 2019 11:49
-
-
Save shangyilim/10eeca2a321ef7d7fe9f11382469ffab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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