Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emmanuellaalbuquerque/estudos-firebase
https://github.com/emmanuellaalbuquerque/estudos-firebase
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/emmanuellaalbuquerque/estudos-firebase
- Owner: EmmanuellaAlbuquerque
- Created: 2024-03-17T19:54:33.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-19T16:14:54.000Z (10 months ago)
- Last Synced: 2024-10-23T13:44:37.760Z (3 months ago)
- Language: JavaScript
- Size: 4.79 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Estudos Firebase
![Logo do projeto](.github/assets/LogoDoProjeto.png)
## Firestore Database
### Cloud Firestore- Banco de dados não-relacional
- Baseado em Coleções e Documentos
> **Ex.: Na Coleção Users** => \
> Cada usuário é um documento!### Com Doc Ref
- Busca uma única vez e encerra a conexão
```jsx
// Com document referenceconst docRef = doc(db, "nomeDoDoc", "idDoDoc")
getDoc(docRef).then((snapshot) => {
const data = snapshot.data();
})
```### Com Snapshot - Realtime
- Observer - “Olheiro”
```jsx
// Com snapshot - Realtimeconst docRef = doc(db, "nomeDoDoc", "idDoDoc")
onSnapshot(docRef, (doc) => {
const data = doc.data();
})
```
![Snapshot (Realtime) - Projeto Expo with Firebase ](.github/assets/onSnapshotRealtimeObserver.png)