我只是想找到这个布尔值,如果它是true,那么它将执行代码。否则,它将执行另一个代码。我似乎无法在Firebase中读取此布尔值。
This is the data I am trying to read.
它说here我可以做.get(fieldPath)
,但是我做错了。 Firebase文档确实很糟糕。哈哈
checkIfLoggedIn = () => {
firebase.auth().onAuthStateChanged(user => {
if (user) {
const uid = firebase.auth().currentUser.uid;
const db = firebase.firestore();
db.collection('users')
.doc(uid)
.get('uid.isStore')
.then(snapshot => {
// Trying to find how to do this
console.log(snapshot);
});
this.props.navigation.navigate('mainNav');
} else {
this.props.navigation.navigate('signup');
}
});
};