firebase-realtime-database

Can Firebase Realtime Database effectively loop through billions of posts and retrieve them by the users that posted them?

纵饮孤独 提交于 2020-01-22 02:00:42
问题 I am developing an iOS app with Firebase Realtime Database. The app will potentially have billions of posts with a number of images and data that needs to be retrieved based on the people a specific user follows (something like Instagram). I understand that the best practice in Firebase is to structure data as flat as possible which would mean having a "Posts" node with potentially billion of entries, which I would then filter by a kind of 'posted_by' parameter. This begs two questions: 1)

Android - Return boolean value relative Firebase

不想你离开。 提交于 2020-01-21 13:59:14
问题 public boolean checkGold(final int gold){ mRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { String value = dataSnapshot.getValue(String.class); goldparse = Integer.parseInt(value); if (gold > goldparse){ /*Return*/ } } @Override public void onCancelled(FirebaseError firebaseError) { } }); return false; } I have method to check gold in outside but how to return false in method onDataChange . Thanks. 回答1: Firebase

Android - Return boolean value relative Firebase

我是研究僧i 提交于 2020-01-21 13:57:15
问题 public boolean checkGold(final int gold){ mRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { String value = dataSnapshot.getValue(String.class); goldparse = Integer.parseInt(value); if (gold > goldparse){ /*Return*/ } } @Override public void onCancelled(FirebaseError firebaseError) { } }); return false; } I have method to check gold in outside but how to return false in method onDataChange . Thanks. 回答1: Firebase

Error: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp()

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-21 10:34:39
问题 I have a firebase database linked up to two apps, one being an iOS app and another being a web app coded in node.js which is a basic algorithm that sets data to the database. When ever i am running the algorithm i am confronted with- Error: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp(). at Error (native) at R (/Users/dd/Desktop/Code/NODE/node_modules/firebase/app-node.js:22:335) at a (/Users/dd/Desktop/Code/NODE/node_modules/firebase/app-node.js:20:68) at

Query Firebase Database with two between conditions

别来无恙 提交于 2020-01-21 10:15:10
问题 I'm wondering if it's possible to return a list of values from my Firebase database where each element satisfies two conditions. For example, if my database looked like this: MYAPP |_______________items | |_____OshwYF72Jhd9bUw56W7d | | | | | |__item_name:"plank_5" | | |__length:"120" | | |__width:"50" | | | |_____KbHy4293dYgVtT9pdoW | |_____PS8tgw53SnO892Jhweh | |_____Gicuwy8r23ndoijdakr | |___customers And I want to query the database for the item_name of every item that has a length of

Why does UnityWebRequest return unkown error when I do a GET request on Linux?

断了今生、忘了曾经 提交于 2020-01-21 09:58:10
问题 This is my code: public class DatabaseHandler : MonoBehaviour { string url = "https://fakeid.firebaseio.com/"; void Start() { StartCoroutine(GetLevelsCoroutine()); } IEnumerator GetLevelsCoroutine() { using (UnityWebRequest www = UnityWebRequest.Get(url)) { www.SetRequestHeader("X-Firebase-Decoding", "1"); yield return www.SendWebRequest(); if (www.isDone) { Debug.Log(www.error); string result = www.downloadHandler.text; Debug.Log(result); } } } } The result variable is null and the www.error

FirebaseRecyclerAdapter unable to populate result [duplicate]

纵然是瞬间 提交于 2020-01-21 09:41:51
问题 This question already has answers here : FirebaseListAdapter not pushing individual items for chat app - Firebase-Ui 3.1 (2 answers) Closed 2 years ago . I want to display EmployeeDetails by using FirebaseRecyclerAdapter in RecyclerView and by not using FirebaseListAdapter. But the activity is displaying nothing Firebase: "EmployeeDetails" : { "3dTxdRlBVUZ0jzH4U5MR4TOKZnD2" : { "address" : "na", "name" : "na", "phoneNum" : "na", "type" : "Employee" }, "wEz6XRMQcAU9cQJLR82uVwVMrC83" : {

Firebase count num children of parent

梦想的初衷 提交于 2020-01-21 08:55:47
问题 I'm trying to get the number of children for a parent node in js firebase. I'd like to have: 'user': { '-Yuna99s993m': { count: 1}, '-Yada99s993m': { count: 2}, } I'm creating a cloud function witch every time a new node is entered it should add count equal to numChildren of user node. exports.setCount = functions.database.ref('/user/{userId}').onWrite(event => { // This doesn't work const count = event.data.ref.parent.numChildren(); return event.data.ref.update({ count }); }); Any help to

Is there a way to make the firebase realtime database presence system detect disconnect faster

主宰稳场 提交于 2020-01-21 07:35:47
问题 I am creating a flutter app, it would be essential to detect almost immediately a user goes offline from the realtime/firestore database and notify other users of the same. I have tried the recommended method of subscribing to .info/connected in the realtime DB and also update a firestore DB. FirebaseDatabase.instance .reference() .child('.info') .child('connected') .onValue .listen((data) { if (data.snapshot.value == false) { // Internet has been disconnected setState(() { state.connected =

Is there a way to make the firebase realtime database presence system detect disconnect faster

江枫思渺然 提交于 2020-01-21 07:35:30
问题 I am creating a flutter app, it would be essential to detect almost immediately a user goes offline from the realtime/firestore database and notify other users of the same. I have tried the recommended method of subscribing to .info/connected in the realtime DB and also update a firestore DB. FirebaseDatabase.instance .reference() .child('.info') .child('connected') .onValue .listen((data) { if (data.snapshot.value == false) { // Internet has been disconnected setState(() { state.connected =