Questions tagged [firebase-realtime-database]

Firebase Realtime Database is a cloud hosted, NoSQL, JSON database that provides offline caching and synchronization. Do NOT use this tag for questions about Cloud Firestore; instead use the [google-cloud-firestore] tag.

About Firebase Realtime Database

Firebase Realtime Database is a component of the Firebase suite of tools for cross-platform application development.

  • Intuitive and easy-to-use API
  • Remains responsive regardless of network latency or Internet connectivity so your Firebase app works offline. Data synchronizes when connectivity returns
  • Handles the complexity of realtime synchronization and provides flexible conflict resolution
  • Accessible directly from client SDKs, or from your server with the REST API

To learn more: Firebase Realtime Database for SQL Developers (video series)

Related tags

40037 questions
29
votes
2 answers

Firebase value event don't get triggered all the time while offline

I have the following path pattern: /ID_Company/boxes/timestamp_of_the_day/ID_box Let's say I just started a new day and I'm offline. Right now on Firebase DB, the path /ID_Company/boxes/timestamp_of_TODAY doesn't exist, neither in the cache. No I…
Nico
  • 6,269
  • 9
  • 45
  • 85
29
votes
9 answers

How to remove all data from a Firebase database?

I started using a code that using Firebase realtime database. I implemented it to my solution. Connection and control was perfect, so I used it for the production environment. After a while I was doing upgrade and I need remove all data again - but…
Bruno
  • 6,623
  • 5
  • 41
  • 47
29
votes
1 answer

Difference between addValueEventListener() and addListenerForSingleValueEvent() of firebase

As the title says, I want to know the difference between addValueEventListener() and addListenerForSingleValueEvent() of Firebase.
Mehdi Glida
  • 547
  • 2
  • 5
  • 11
29
votes
4 answers

java.lang.NoClassDefFoundError: Failed resolution Failed resolution of: Lcom/google/android/gms/common/internal/zzab;

I am following a tutorial (link) to upload images to Firebase database but am getting the below error. I rechecked the gradle dependencies and also enabled multidex support but error still remains java.lang.NoClassDefFoundError: Failed resolution…
Kartik Shandilya
  • 3,796
  • 5
  • 24
  • 42
29
votes
3 answers

Firebase DB - How to update particular value of child in Firebase Database

I want to update my display name in the code below. How can I update displayName? My database structure is: -Users -KUanJA9egwmPsJCxXpv displayName:"Test Trainer" email:"test@gmail.com" uid:…
Nishith Adhvaryu
  • 427
  • 2
  • 6
  • 12
29
votes
3 answers

Firebase : What is the difference between setPersistenceEnabled and keepSynced?

I thought the whole time when I used the following all data for chat conversation will be available offline at any time. Which somehow isn't and all nodes are loaded from the server. FirebaseDatabase.getInstance().setPersistenceEnabled(true); Then,…
Relm
  • 7,923
  • 18
  • 66
  • 113
29
votes
2 answers

Firebase @Exclude with kotlin data class

I have this data class in Kotlin (example): import com.google.firebase.database.Exclude data class User(val name: String = "", @Exclude val age: Int = 0) And I don't want to save the age property in firebase. @Exclude should do this but it does…
Dan
  • 355
  • 3
  • 7
29
votes
5 answers

Is it possible to rename a key in the Firebase Realtime Database?

I was wondering, is there a way to update the key value? Let´s use the following data: I am using set() to write the data. Now, I want the user to edit their bookTitle and it needs to change on both places. I tried using update() but I can´t seem…
Luis Rodriguez
  • 503
  • 1
  • 6
  • 12
29
votes
2 answers

How to write .indexOn for dynamic keys in firebase?

I have data set up like this: Tasks:{ Group 1:{ pushid1:{ date: 18921949021, title: "Do something" }, pushid2:{ date: 18921949021, title: "Do something else" } }, Group 2:{ pushid3:{ date:…
Marty.H
  • 1,194
  • 4
  • 16
  • 29
29
votes
3 answers

Setting Singleton property value in Firebase Listener

I'm currently testing out Firebase along with a Singleton model I plan to use to access during the lifecycle of the whole app. I'm now stuck with something that seems really trivial but I can't figure it out for the life of me. I have a sample of…
29
votes
5 answers

How to Retrieve a List object from the firebase in android

I am having trouble retrieving a List from the Firebase. I have no trouble storing it, but as soon as I try to cast dataSnapshot.getValue() to ArrayList my app crashes, giving an exception: HashMap cannot be casted to ArrayList But when I tried to…
28
votes
2 answers

Link Android Room Database with Firebase Realtime Database

I am using Android Room Database for creating the database for my android app. It works perfectly for me locally but I cannot link to a server to have it online as well. I am using Firebase for Authentication. I am trying to use Firebase Realtime…
28
votes
4 answers

Keep line breaks in HTML string

Using Angular 5 and Firebase, I am storing and retrieving movie review information. When creating and editing the review, line breaks are kept (I assume using an ngModel has something to do with this). However, when retrieving the review from a…
cfoster5
  • 1,696
  • 5
  • 28
  • 42
28
votes
3 answers

Limitation to number of documents under one Collection in firebase firestore

I am new to firebase firestore and searched, but could not find the limitation for the number of documents that can be handled under one collection. Can anybody help me out to know please.
28
votes
5 answers

Migrate Firebase Realtime Database to Firestore

I am looking for the best way to migrate my apps database which is using firebase realtime database to the new Cloud Firestore database. I am confident for the project I am working on I don't need to make any data schema changes, so I am pretty much…
Luke
  • 612
  • 1
  • 6
  • 19