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
65
votes
5 answers

How to Convert Firebase data to Java Object...?

Using Firebase Library to send data to the server in the form Message(String, String) added to the HashMap Example: Firebase fb = new Firebase(URL); Firebase msgRef = fb.child("finished"); HashMap msgList = new…
Moosa Baloch
  • 1,175
  • 1
  • 13
  • 25
64
votes
6 answers

Firebase (FCM): open activity and pass data on notification click. android

There should be clear implementation of how to work with Firebase notification and data. I read many answers but can't seem to make it work. here are my steps: 1.) I am passing notification and data to android in PHP and it seems to be fine: $msg =…
63
votes
4 answers

Check if value exists in firebase DB

Is there a method in firebase, which can check if value exist in DB? Firebase has method .exists(), but according to docs it checks only the keys. I have the following structure: { "users": { "-KKUmYgLYREWCnWeHCvO": { "fName": "Peter", …
Runtime Terror
  • 6,242
  • 11
  • 50
  • 90
62
votes
12 answers

Where can I find my Firebase reference URL in Firebase account?

In the third last line of the below code, how can I find the firebase URL. I am not able to find it. Can anyone provide me the best link on how to setup firebase facebook login with android. public void saveUser() { //Add YOUR Firebase Reference…
60
votes
6 answers

Is there a way to use GeoFire with Firestore?

GeoFire is tightly coupled to the Realtime Database, while geo-queries are a common functional dependency of many apps that are looking to migrate to Firestore. Is there any way to replicate the hashing/retrieval of locations in the Firestore…
60
votes
11 answers

Setting custom key when pushing new data to firebase database

Well, I am new to Firebase and I want to have my own keys while pushing new data to database. Problem: FireBase.push().setValue(mapped_values); This gives structure like below: How can I create my own custom key there? Such as username or…
60
votes
1 answer

Firebase data structure and url

I'm new in Firebase and nosql so bear with me to use reference to sql. So my question is how to structure the data in firebase? In firebase, is that mean every "new firebase" = "new Database" or "table" in mysql? If in my real time web app, I have…
vzhen
  • 11,137
  • 13
  • 56
  • 87
59
votes
6 answers

How to return DataSnapshot value as a result of a method?

I don't have much experience with Java. I'm not sure if this question is stupid, but I need to get a user name from Firebase realtime database and return this name as a result of this method. So, I figured out how to get this value, but I don't…
Ilya S
  • 751
  • 1
  • 10
  • 10
59
votes
4 answers

Google Firebase Error(Function returned undefined, expected Promise or value)

I'm developing Server with Firebase. I had copied Google Developer's Video on Youtube. It works well, but on log there is an error: Function returned undefined, expected Promise or value It says function returned undefined, but I make function…
57
votes
3 answers

Restricting child/field access with security rules

I'm writing an app that allows users to submit nominations which are moderated before being displayed to other users. This requires a number of restrictions I've so far been unsuccessful in implementing with security rules: Hide any nominations…
Simen Brekken
  • 1,468
  • 1
  • 15
  • 23
56
votes
7 answers

How to delete from firebase realtime database?

I am using Firebase realtime database in Android app, and have data like this: How can i delete the record "Apple" (marked in picture)? According to the docs, to remove an item you call removeValue() on the reference. But to get the reference i…
Amit Jayant
  • 2,501
  • 2
  • 29
  • 38
54
votes
4 answers

Android Firebase, simply get one child object's data

I have been looking for a way to get one child object's data in Android Firebase. I have found things like Firebase retrieve child Android. All the solutions are suggesting using a "ChildEventListener", however I need to get this data at this…
Bobby
  • 1,416
  • 1
  • 17
  • 30
54
votes
5 answers

How to perform sql "LIKE" operation on firebase?

I am using firebase for data storage. The data structure is like this: products:{ product1:{ name:"chocolate", } product2:{ name:"chochocho", } } I want to perform an auto complete operation for this data, and normally i…
yrazlik
  • 10,411
  • 33
  • 99
  • 165
52
votes
3 answers

Add extra User Information with firebase

I have integrated firebase auth with my android app. Lets say a user has a mail abc@abc.com. I want to add some extra information to the user like the name of the user, occupation and address. How can i connect the user auth table with my android…
49
votes
1 answer

What's the difference between the firebase and the firebase-admin npm module?

I want to build a Node.js web app using Firebase (authentication, database and storage). But I get confused on which module should I use, firebase or firebase-admin (or both).