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
43
votes
2 answers

How to write denormalized data in Firebase

I've read the Firebase docs on Stucturing Data. Data storage is cheap, but the user's time is not. We should optimize for get operations, and write in multiple places. So then I might store a list node and a list-index node, with some duplicated…
collardeau
  • 800
  • 7
  • 13
42
votes
3 answers

Firebase email saying my realtime database has insecure rules

I recently received an email from firebase telling me that my realtime database has insecure rules. These are the rules that I have set: { "rules": { ".read": "auth != null", ".write": "auth != null" } } Is this not a secure…
42
votes
4 answers

How do you solve the error KeyError: 'A secret key is required to use CSRF.' when using a wtform in flask application?

I have been trying to build a web app using flask and wtforms and a firebase database, but I keep getting the error message "KeyError: 'A secret key is required to use CSRF.'" and I don't know how to solve it. here is my code: from flask import…
42
votes
4 answers

orderByChild not working in Firebase

I am trying to query my database such that it retrieves an ordered list based on a child key. I do it as follows (see below), but nothing happens, meaning that it returns an object ordered exactly in the same way as it is stored in the Firebase…
WJA
  • 6,676
  • 16
  • 85
  • 152
41
votes
7 answers

Where can I find my Firebase apiKey and authDomain

Where can I find my Firebase apiKey and authDomain? I'm setting up my environment to connect to my database. export const environment = { production: false, firebase: { apiKey: '...', authDomain: '...', databaseURL:…
AngularM
  • 15,982
  • 28
  • 94
  • 169
41
votes
2 answers

Firebase : Differences between realtime database and file storage

I learnt about real-time data storage and hosting storage from this post Difference between Data Storage and Hosting Storage? But i am still not clear about real time Database and and newly introduced file storage. Does anybody have some brief…
erluxman
  • 18,155
  • 20
  • 92
  • 126
41
votes
8 answers

How to bypass the Firebase cache to refresh data (in Android app)?

On an Android application which must works offline most of the time I need, when it's online, to do some synchronous operations for i.e. : User myUser = MyclientFacade.getUser(); If (myUser.getScore > 10) { DoSomething() } Where User is a…
ThierryC
  • 1,794
  • 3
  • 19
  • 34
40
votes
2 answers

How to get all child's data in firebase database?

I have this firebase database and i need to get all phone numbers of users , which listener shall i use to get all childes? Every user is added as an object with user-ID as a name of that object, I need to retrieve this objects without knowing…
m.yuki
  • 815
  • 1
  • 10
  • 19
40
votes
1 answer

Does Firebase cache the data?

I read somewhere a claim that Firebase caches the data. So I ran this test that reads a semi large volume of data (about 400KB). Here is the relevant code. firebase.initializeApp(config); var counter = 0; console.time('firebase answered…
Pier
  • 10,298
  • 17
  • 67
  • 113
40
votes
6 answers

How do I check if a firebase database value exists?

I'm using the Realtime Database with Google's Firebase, and I'm trying to check if a child exists. My database is structured as the following - / (root) - /users/ –- /james/ -- /jake/ - /rooms/ -- /room1/ --- (room 1 properties) --…
James
  • 787
  • 1
  • 7
  • 15
40
votes
19 answers

Firebase Data Desc Sorting in Android

I am storing data in Firebase storage. Object Comment with attribute timestamp. When I push data from device to Firebase I'm populating timestamp with currentTime and store in long data type. When I do retrieving the data with…
40
votes
3 answers

Firebase Query Double Nested

Given the data structure below in firebase, i want to run a query to retrieve the blog 'efg'. I don't know the user id at this point. {Users : "1234567": { name: 'Bob', blogs: { 'abc':{..}, …
Chris Raheb
  • 422
  • 1
  • 4
  • 8
39
votes
2 answers

Is it necessary to encrypt chat messages before storing it into firebase?

As far as I know, Firebase sends data over an HTTPS connection, so that the data is already being encrypted. Although Firebase provides security rules to protect my data structure, I can still be able to see the string messages in the database. I'm…
39
votes
5 answers

How to get the key from a Firebase data snapshot?

I'm able to query my users array with an e-mail address and return the user's account info: users.orderByChild('email').equalTo(authData.user.email).once('value').then(function(snapshot) { console.log(snapshot.val()); …
Thomas David Kehoe
  • 10,040
  • 14
  • 61
  • 100
39
votes
12 answers

Client doesn't have permission to access the desired data in Firebase

I have a page that is calling addCheckin() method which is inside a controller. In the controller, I am trying to create a reference as follows: var ref = firebase.database().ref("users/" + $scope.whichuser + "/meetings/" +$scope.whichmeeting +…