docs(database): persistence is disabled by default (#3899)

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
This commit is contained in:
Anderson Addo
2020-07-07 14:31:50 -04:00
committed by GitHub
parent 4cd8363212
commit a5e4025256
2 changed files with 7 additions and 7 deletions

View File

@@ -10,8 +10,8 @@ and automatically managed by the Firebase SDKs.
# Enabling Persistence
Persistence is automatically enabled by default when using Realtime Database, however it
[can be disabled](/database/usage#disabling-persistence). To enable persistence, call the `setPersistenceEnabled`
Persistence is disabled by default when using Realtime Database, however it
[can be changed to be enabled by default in the firebase.json](/database/usage#enabling-persistence). You can also enable persistence programmatically, by calling the `setPersistenceEnabled`
as early on in your application code as possible:
```js

View File

@@ -362,18 +362,18 @@ secondaryDatabase.ref();
# firebase.json
## Disabling persistence
## Enabling persistence
By default the Realtime Database persists data on the user application, and is used by the SDKs for offline usage
and caching. To disable this functionality, update the `database_persistence_enabled` key in the `firebase.json` file:
The Realtime Database can be set to persist data on the user application to be used by the SDKs for offline usage
and caching. To enable this functionality, update the `database_persistence_enabled` key in the `firebase.json` file:
```json
// <project-root>/firebase.json
{
"react-native": {
"database_persistence_enabled": false
"database_persistence_enabled": true
}
}
```
To enable persistence, view the [Offline Support](/database/offline-support) documentation.
For more on persistence, view the [Offline Support](/database/offline-support) documentation.