firebase-realtime-database

Firebase 3 - Can't retrieve data from database (Web)

风流意气都作罢 提交于 2019-12-24 00:48:39
问题 I'm working on a webapp using Firebase 3 (the latest version) for the first time but I'm having troubles with retrieving data on my page. I've created a NodeJS test app from Heroku , then I'm trying to retrieve my data in JSON format (ref's path goes to my data array) saved in my Firebase realtime database . I've followed the doc, but without results. Here's my code: <script src="https://www.gstatic.com/firebasejs/live/3.0/firebase.js"></script> <script> // Initialize Firebase var config = {

Firebase connection with codeigniter in php

为君一笑 提交于 2019-12-24 00:48:26
问题 I want to connect firebase database with my codeigniter project in php. I not able to find the exact solution and library.. Please recommend the correct library with correct steps that I should follow to connect. Thanks in advance. 回答1: You can use FireBase in your project by using https://github.com/eelkevdbos/firebase-php use Firebase\Firebase; $fb = Firebase::initialize(YOUR_FIREBASE_URL, YOUR_FIREBASE_SECRET); //or set your own implementation of the ClientInterface as second parameter of

How to handle tags in a noSQL database

别说谁变了你拦得住时间么 提交于 2019-12-24 00:46:08
问题 I have a noSQL db with products. These products obviously have some characteristics and I can filter the products out by their properties. How does this work with tags? More specifically, how should I structure the nodes such that I can filter out items with a specific tag? Firebase Follow up if you are familiar with Firebase .equalTo(): how would I structure my FB db and how would I query out items with a specic tag? One thing I was thinking of is to have seperate properties for the nodes, e

Firebase retrieve highest 100 score

回眸只為那壹抹淺笑 提交于 2019-12-24 00:24:44
问题 This is a screen shot of my firebase: I am trying to retrieve the highest 100 score in firebase database I am using this code to add new node to firebase: Map<String, String> post1 = new HashMap<String, String>(); post1.put("name",name); post1.put("score",score); myRef.push().setValue(post1); And this is the code I am using to retrieve the highest 100 score which doesn't work (the code works but it is not retrieving the highest 100 score) Query queryRef = myRef.orderByChild("score")

Update infromation in Real-Time from Firebase in AngularJS

旧街凉风 提交于 2019-12-24 00:19:56
问题 I made a applicaion for show information from Firebase with AnguarJS. For this moment, information is updated after refresh page, but i want to update my information in real time. Here is my angular code: var root = angular.module('root',["services", "firebase"]); root.controller("root4",['$sce', "$scope", function($sce,$scope){ var ref = new Firebase("https://web-quickstart-8326d.firebaseio.com"); var locationRef = rootRef.child('location'); locationRef.once("value", function(snapshot) {

Firebase Database - Wrong Encoding

戏子无情 提交于 2019-12-24 00:19:01
问题 I am new to Firebase and I want to use their Database, but there seems to be some issues with the encoding. Here is my example json with UTF-8 Encoding: [ { "Stack": "This is madness! äüöß ", "Overflow": 666 } ] And this is the result, when I import the json to Firebase: What can I do to import characters like "äüöß" to the Firebase Database? Thank you! 回答1: thank you for your answers. I used the Web Console to import the json (https://console.firebase.google.com/project/[projectname]

Firebase database rules. Allow when wildcard's child === auth.uid

℡╲_俬逩灬. 提交于 2019-12-24 00:15:56
问题 Structure: { "accounts" : { "JGeRgwAUBM..." : { "active" : true, "created" : 1468406951438, "key" : "JGeRgwAUBM..." } } Rules: { "rules": { ".read": false, ".write": false, "accounts": { "$uid": { ".read": "$uid === auth.uid", ".write": "$uid === auth.uid" } } } } Goal: Instead of using the auth.uid as key for the data, I would rather prefer to use the generated key from push().getKey() { "accounts" : { "theKeyIGetFrom: push().getKey()" : { "active" : true, "created" : 1468406951438, "auth

How to flatten data on Firebase

跟風遠走 提交于 2019-12-24 00:05:57
问题 I am developing an application where users post products inside categories. I am using firebase and I am trying to flatten the data on the database but I am not sure about the connections of the posts with the categories. Here is the database design: "categories": { "category1": { "id": "1", "name": "computers" }, "category2": { "id": "2", "name": "Furniture" }, "category3: { "id": "3", "names": "Books" }, } "users":{ "email": "test@gmail.com" "posts": { "post1": { "id": "1" "title": "Selling

How Firebase on and once differ?

两盒软妹~` 提交于 2019-12-24 00:02:48
问题 i am facing problems with understanding more about on and once in firebase API. Assume I have this DB structure When I listen for child_added, it works as expected. firebase.database().ref(this.getRootRef()) .orderByChild('createdAt') .limitToLast(NUM_MSG_PER_REQUEST) .on('child_added', (datas) => { if (datas) { _callback(datas.val()); } }); But when I would to filter with once, nothing effected. firebase.database().ref(this.getRootRef()) .orderByChild('createdAt') .endAt('createdAt', '2019

Firebase “symlink” to another node

痞子三分冷 提交于 2019-12-23 23:03:06
问题 In relation to my other question about modelling a real user-facing tree structure (Using firebase tree structure to represent a "document outline" structure directly), I was thinking of putting in place a generic approach to "symlinking", at certain nesting levels, to overcome the 32 nesting levels limitation and the need to fetch all sub-nodes at once. Are there some "best-practices" for "symlinking" in firebase? E.g.: syntax (contents, key-value structure) for a firebase node which would