firebase-realtime-database

Retrieving data from firebase while sorting it correctly

ⅰ亾dé卋堺 提交于 2020-01-07 02:29:14
问题 I have this structure in my firebase database "metadata" : { "2017" : { "Februari" : { "-Kc3BF0V1iLgtnI65LuR" : { "date" : "2017-02-03T13:36:38.311Z", "price" : 90 }, "-Kc3BF0V1xxfrtnI65OlS" : { "date" : "2017-02-03T13:36:38.311Z", "price" : 90 } }, "Januari" : { "-Kc3E5bpxpo3RpSHH3fn" : { "date" : "2017-01-11T13:50:12.264Z", "price" : 45 } } } } What I am trying to achieve in my app is to show a list like this > Januari > - 45 (=price) > > Februari > - 90 () > - 240 The thing is I am able to

Firebase database - Retrieve data from database

六眼飞鱼酱① 提交于 2020-01-07 01:54:32
问题 I am new firebase developer, a am developing an android app, that using firebase database. This is a part my database. And this is my model class: public class Exam { private String id; private int subject; private String school; private Long examineDate; private int likeCount; private HashMap<String,Object> timeStampSubmit; public Exam(){}; public Exam(String id, int subject, String school, Long examineDate, int likeCount) { this.id = id; this.subject = subject; this.school = school; this

Can't create a chaining promise with firebase and AngularJS, a FirebaseArray with two sequential calls to fetch data from two different tables linked

廉价感情. 提交于 2020-01-06 21:14:45
问题 I have the two following tables with services and categories: - servicecat - catid - name : "Category Name" - services - srvid1 : true - srvid2 : true - srvid3 : true - services - srvid - name: "Service Name" - Details: "blabla" - servicecat: - catid1 : true - catid2 : true I'm trying to build a firebaseArray to show when a user click on a service its information and categories. <script> var app = angular.module("sampleApp", ['firebase']); var fb = firebase.database().ref(); app.factory(

Can't create a chaining promise with firebase and AngularJS, a FirebaseArray with two sequential calls to fetch data from two different tables linked

混江龙づ霸主 提交于 2020-01-06 21:14:15
问题 I have the two following tables with services and categories: - servicecat - catid - name : "Category Name" - services - srvid1 : true - srvid2 : true - srvid3 : true - services - srvid - name: "Service Name" - Details: "blabla" - servicecat: - catid1 : true - catid2 : true I'm trying to build a firebaseArray to show when a user click on a service its information and categories. <script> var app = angular.module("sampleApp", ['firebase']); var fb = firebase.database().ref(); app.factory(

Remove the previous markers as the location updates

社会主义新天地 提交于 2020-01-06 21:07:21
问题 I have placed some markers on map. As the location of the marker changes it places another marker on the map but keeping the last marker as it is which creates multiple markers of the same id on the map. I there any way to clear the previous marker as the location updates. I am retrieving location changes from firebase database in any array. Here is my code: import android.content.Intent; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.os

Firebase child_added event listener returning duplicate data

梦想与她 提交于 2020-01-06 19:59:22
问题 I am using Firebase child_added to watch for new entries being added to my database. It seemed to work for a while but then I noticed some issues when leaving the connection idle. If I leave my app open for a prolonged period of time when Firebase returns duplicates. I think it maybe down to the connection being dropped and then established. Here is my code. getVoicemailList: function() { var self = this; var userId = firebase.auth().currentUser.uid; firebase.database().ref('voicemails/' +

Paginating Firebase data through the REST API on property without duplicates

≯℡__Kan透↙ 提交于 2020-01-06 19:54:11
问题 Is there an equivalent of startAt(value, [key]) in the REST API? Specifically the optional key param. https://www.firebase.com/docs/web/api/query/startat.html Details: I am paging through a collection on a property (dueDate) using the REST API. Paging through works but, since the values for dueDate are not unique, each successive page may contain several duplicates. In the worst case, there may be more duplicates on a date than the page size, which would break the pagination. Because of the

Firebase update data not working

丶灬走出姿态 提交于 2020-01-06 19:51:39
问题 Hi I wanted to update the firebase data, but when I update it insert to a new data instead of updating the specific data that I set which is the lastname equal to 'hoo' fb.orderByChild("Lastname").equalTo('hoo').once("value", function(snapshot){ console.log(snapshot.ref()); console.log(snapshot.val()); // var snapref = snapshot.ref(); snapshot.ref().update({ FirstName: 'yoyo1' }); }) Edit: fb.orderByChild("Lastname").equalTo('hoo').once("child_added", function(snapshot){ console.log(snapshot

Specify condition and limit for firebase realtime database request

青春壹個敷衍的年華 提交于 2020-01-06 18:44:51
问题 I'm trying to store some certain information in the firebase realtime database. My database structure looks like this: { "contacts" : { "-KdD1f0ecmVXHZ3H3abZ" : { "email" : "ksdsd@sdsd.com", "first_name" : "John", "last_name" : "Smith", "organization_id" : 1 }, "-KdG4iHEYjInv7ljBhgG" : { "email" : "superttest@sds213123d.com", "first_name" : "Max1", "last_name" : "Rosse13131313l", "organization_id" : 1 }, "-KdGAZ8Ws6weXWo0essF" : { "email" : "superttest@sds213123d.com", "first_name" : "Max1",

Retrieve null values from Firebase database Android

感情迁移 提交于 2020-01-06 18:14:11
问题 I'm searching by key in my Firebase database, but it retrieves null and I don't know why. data.getUrl() or data.getText() both give me null values. In debugging, before line test data = dataSnapshot.getValue(test.class); it shows me that data should've retrieved what I'm looking for, but when that line executes, it gives me null. Database structure: { "images" : { "partner " : { "text" : "partner", "url" : "http://res.cloudinary.com/dg3jylcsw/image/upload/v1483565650/sister_x3lv6j.png" },