firebase-realtime-database

Get specific value from Firebase

删除回忆录丶 提交于 2019-12-24 19:39:46
问题 I have this firebase database: That has been created with this code: private DatabaseReference mDatabase; private EditText tbfirstname; private EditText tblastname; private EditText tbemail; private Button btnSubmit; private String str_firstname; private String str_lastname; private String str_email; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mDatabase = FirebaseDatabase.getInstance().getReference(

how to check if data is already in html table using firebase real time database?

荒凉一梦 提交于 2019-12-24 19:29:45
问题 I have a live listener on my database data in my HTML table that is generated by javascript and when I add a new entry or delete an old entry, the data that was previously in the table gets duplicated. var database = firebase.database().ref().child('transactions'); database.on('value', function(snapshot){ if(snapshot.exists()){ var content = ''; snapshot.forEach(function(data){ var CustomerName = data.val().CustomerName; var AmountSent = data.val().AmountSent; var TimeEffected= data.val()

How can i update my information in different location? Android Firebase

荒凉一梦 提交于 2019-12-24 19:26:38
问题 Click this to see Firebase Data Structure I want to update my information (firstname, middlename, lastname) which is in a different location. I'm updating my information using student account. It only update under student but I don't know how to update it under teacher. If I update my first name, middle name, last name, I want my first name, middle name, and last name update also under the two section under the class. Please help me. 回答1: To update a record in a Firebase database, you can use

Firebase how to use orderbychild

那年仲夏 提交于 2019-12-24 19:05:04
问题 medics/randomid/medicname = someValue I want this medic name get listview with firebase dref = FirebaseDatabase.getInstance().getReference().child("users").child(kullaniciuid).child(medic).orderByChild("medicname"); dref.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { ss = dataSnapshot.getValue().toString(); s = dataSnapshot.getKey(); list.add(ss); barkodlist.add(s); count++; if(count >= dataSnapshot.getChildrenCount()

Query Firebase nested data to check specific value - iOS Swift

邮差的信 提交于 2019-12-24 19:04:44
问题 I have an array of User ID Strings and I want to query data in Firebase Realtime Database to see if each User ID has a specific gender. var nearbyUserArray = [String]() Below is an example of the data I have in Firebase. The second level deep is the User ID (0UFhIgGAwIY1btnBeNaNkJruYKJ3). What I am trying to do is loop through my User ID array and for each User ID check if that specific user is Male. If the user is Female, remove that User ID from the array. "profiles" : {

Load existing Geofire location if one exists

柔情痞子 提交于 2019-12-24 18:58:29
问题 I would like Geofire to do one of two things; 1 - Look for a venue location in Firebase and if none exists, 2 - Create one. So to clarify: User creates a post based on the current venue. Geofire checks to see if it already has a venue (Long and Lat cocoordinates) on record for that geolocation. If it DOES have that location stored in Firebase then it takes the user's new post and ADDS it to the same venue. If Geofire DOES NOT detect a location in Firebase it creates a new venue and attaches

Firebase can't push data given the ruleset

徘徊边缘 提交于 2019-12-24 18:54:10
问题 I'm trying to create a password protected chat room and found this SO answer to user as an example: Firebase: approach to storing room passwords The problem is, given the ruleset in the answer, I can't figure out how to push new data. My rules looks like this: { "rules": { "myApp":{ "chatRooms" : { "$roomID" : { "password": { ".read": "false", ".write": "root.child('myApp/chatRooms/' + $roomID + 'chatInfo').child('admin').val() == auth.uid" }, "chatInfo" : { ".read":true, ".write": "data

Get Double From Firebase

两盒软妹~` 提交于 2019-12-24 18:53:29
问题 I am trying to get a double from firebase object using dataSnapshot but each time I try to, I'm getting an error saying that java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Double and when I try to maybe Cast it to a Long just to observe what's gonna happen I get this Error java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Long , so in short the error is vice versa. This is the code I'm using to get my total in Firebase dataSnapshot:

Duplication of rows in Javascript Table

馋奶兔 提交于 2019-12-24 18:53:11
问题 I am quite new to javascript and for some time now i cant figure a solution to a problem that i have on my own. The web application i am building is using javavascript and Firebase. I am creating a table that pulls some data from mysql and display them as a table in my website. The table consists of three columns ID,NAME, AND SURNAME.Along with that i am also creating a new column called Recipient that consists of buttons. The table looks like this: I give a different value to each of the

Convert observe .value to .childAdded in swift

限于喜欢 提交于 2019-12-24 18:51:38
问题 Currently I'm having some problems with this bit of code that is loading data from firebase database into an array. Since this is inside of viewDidLoad I have to empty my array food = [] before loading the data into it, if I don't then it will duplicate all the objects and I will have double duplicates the second time it loads, triple the third time and etc... However this was not a good fix for multiple reasons so what I would like is that it would only add new objects from the database with