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
47
votes
4 answers

How to retrieve data from Firebase Database?

I'm trying to create a simple program that takes name, mobile number and email address from user and then puts the data on Firebase Realtime Database. There are 3 input boxes and a button which on click does the above operation. Here is the…
gegobyte
  • 4,945
  • 10
  • 46
  • 76
47
votes
3 answers

Find out if childEventListener on Firebase has completed loading all data

I'm using Firebase Realtime Database for storing and retrieving data for my Android application. In my activity I retrieve all data (example: list of user data) from Firebase using a childEventListener. I want to show a progress bar as long as the…
Stanley Giovany
  • 583
  • 1
  • 7
  • 12
47
votes
4 answers

Firebase rate limiting in security rules?

I launched my first open repository project, EphChat, and people promptly started flooding it with requests. Does Firebase have a way to rate limit requests in the security rules? I assume there's a way to do it using the time of the request and…
45
votes
6 answers

In Firebase when using push() How do I get the unique ID and store in my database

I am pushing data in firebase, but i want to store unique id in my database also . can somebody tell me,how to push the data with unique id. i am trying like this writeUserData() { var key= ref.push().key(); var newData={ id: key, …
45
votes
1 answer

How to encrypt user data in Firebase

I am using the email/password sign in method for Firebase. I would like to encrypt the data users save into the realtime database before sending it to the database. Firebase already handle the user password, but can I somehow use it to encrypt data…
44
votes
2 answers

Many to Many relationship in Firebase

I have a Firebase database. I have Companies and Contractors. A Contractor can work for more than one Company and a Company can have multiple Contractors. This is a straightforward many to many relationship. I want to be able to answer the questions…
Rob Gorman
  • 3,502
  • 5
  • 28
  • 45
44
votes
3 answers

Firebase - What is the difference between ref and child?

In Firebase, ref and child are used a lot. For example - firebase.database().ref('users/') will work exactly same as firebase.database().ref('users').child(''), so what exactly is the difference between them and when should either…
gegobyte
  • 4,945
  • 10
  • 46
  • 76
44
votes
8 answers

Can multiple android application access same firebase database?

Is it possible for multiple android applications to access a single firebase backend. If no what is the alternative in such situation?
Rage
  • 673
  • 2
  • 6
  • 8
44
votes
6 answers

Google firebase check if child exists

In my app, I need to check if a given element of my database on firebase has a child with a given name. I hoped it could be done by using something along the lines of: DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference(); if…
zomnombom
  • 986
  • 2
  • 9
  • 15
44
votes
14 answers

Get the pushed ID for specific value in firebase android

I want to retrive the id that generated by firebase when I pushed value to it like next I want to retrieve "-KGdKiPSODz7JXzlgl9J" this id for that email I tried by getKey() but it return "users" and when user get value it return the whole object…
Sattar
  • 2,453
  • 2
  • 33
  • 47
44
votes
1 answer

"error": "Index not defined, add ".indexOn"

I have created a database in Firebase which looks like: Now I go into a REST client and issue this query: https://movielens3.firebaseio.com/movieLens/users.json?orderBy="age"&startAt=25&print=pretty It gives me an error: "error": "Index not…
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373
44
votes
3 answers

Why do I get "Failed to bounce to type" when I turn JSON from Firebase into Java objects?

[Disclosure: I am an engineer at Firebase. This question is meant to be a reference question to answer many questions in one go.] I have the following JSON structure in my Firebase database: { "users": { "-Jx5vuRqItEF-7kAgVWy": { …
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
43
votes
4 answers

Set timeout for Cloud Functions for Firebase does not persist in the Console; is this a bug?

Update: I updated the question, to reflect what I described in the body of the question, and what was happening at the time. It also justifies why I did not mark Sanyam's response as correct. There was a bug in the Console that was causing the…
Lindauson
  • 2,963
  • 1
  • 30
  • 33
43
votes
4 answers

How do I deploy Firebase Database Security rules using the command line?

In older versions of Firebase, we could add a rules section to our firebase.json file, and upload new security rules on every deploy. How do we use the firebase-tools v3 command-line tools to deploy database security rules? This page says that it's…
Seth Ladd
  • 112,095
  • 66
  • 196
  • 279
43
votes
5 answers

Delete firebase data older than 2 hours

I would like to delete data that is older than two hours. Currently, on the client-side, I loop through all the data and run a delete on the outdated data. When I do this, the db.on('value') function is invoked every time something is deleted. Also,…