forked from BeingBharat/BSBOceanProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebaseStore.jsx
More file actions
34 lines (31 loc) · 868 Bytes
/
firebaseStore.jsx
File metadata and controls
34 lines (31 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {Button, StyleSheet, Text, View} from 'react-native';
import React from 'react';
import firestore from '@react-native-firebase/firestore';
export default function FireBaseStore() {
const getData = async () => {
const users = await firestore().collection('firstTest').get();
const user = await firestore()
.collection('firstTest')
.doc('FGdSgkO6NxRmlrZPCXWV')
.get();
console.log(users, user);
};
const addDAta = () => {
firestore()
.collection('firstTest')
// Filter results
.where('age', '>=', 18)
.get()
.then(querySnapshot => {
console.log(querySnapshot)
});
};
return (
<View>
<Text>FireBaseStore</Text>
<Button onPress={getData} title="get Data" />
<Button onPress={addDAta} title="filter Data" />
</View>
);
}
const styles = StyleSheet.create({});