firebase-realtime-database

Firebase multi-path update “invalid data; couldn't parse JSON object, array, or value”

不想你离开。 提交于 2020-01-03 02:40:27
问题 I was excited when Firebase announced multi-path updates a while back. I have a fairly complex data structure that requires writes to several locations for managing relationships between entities, so multi-path updates came at the perfect time - I didn't have to worry about making several back-to-back writes/updates (and risk having Firebase rate-limit me). So, I coded everything up, buckled in, and performed a multi-path update (using the Rest API), only to be let down by the following

How to work with Firebase without allowing optional values

流过昼夜 提交于 2020-01-02 23:44:17
问题 I'm new to iOS development and I understand that allowing optional values when an object is initialized is not a 'good citizen' technique. That being said, I've read that it is good practice to always have values set, like this: class Item{ var name: String var color: String init(name: String, color: String) { self.name = name self.color = color } } This looks nice and tidy but how can I do something like that working with Firebase? Look what I've got so far: private func loadPosts(){

query.startAt database rule permission denied

我只是一个虾纸丫 提交于 2020-01-02 20:43:10
问题 Seems like either the query.startAt rule is broken, or I don't understand it. Can someone confirm? Here is the minimal reproducible error. Live example; open Chrome console with CTRL+SHIFT+i. GitHub repo. database.rules.json: { "rules":{ ".read": "query.startAt>0", ".write": false } } index.html <!DOCTYPE html> <html> <body> <script src="/__/firebase/7.6.1/firebase-app.js"></script> <script src="/__/firebase/7.6.1/firebase-database.js"></script> <script src="/__/firebase/init.js"></script>

Two type models and FirebaseRecyclerAdapter in android

冷暖自知 提交于 2020-01-02 20:08:29
问题 I have two types of product in my firebase db which are the following. Model : ProductTypeOne.java package fyp.hkust.facet.model; import java.util.ArrayList; public class ProductTypeOne { private String name; private String brand; private String desc; private String image; private String username; private String uid; private ArrayList<ArrayList<String>> color; public Product() { } public Product(String name,String brand, String desc, String image,String username,String uid,ArrayList<ArrayList

My Firebase Queue doesn't do anything after I changed to Firebase 3

妖精的绣舞 提交于 2020-01-02 18:56:22
问题 I started using Firebase a couple of weeks ago, and had Firebase Queue running on my node.js server code. Clients could push messages to queue/tasks, and the server would resolve them. I cannot replicate this after Firebase has changed to version 3, even though Firebase Queue has been updated and no-one else seems to be having problems. It is probably just a minor bug in my code, but I haven't found it after a couple of days, and I would appreciate it if someone could point it out for me.

Firebase childEventListener return value when path does not exist

偶尔善良 提交于 2020-01-02 16:22:30
问题 Reading the documentation, It seems childEventListener does not fire when the path does not exist. This is a problem since I want to display a message to the user that there is no data. I could add a valueEventListener like in this answer but I'm limiting the query to the latest value i.e query.limitToLast() and a valueEventListener doesn't limitTolast but gets all the data in the path. Example, I have: posts { $userid { $postid { post_content:content timestamp:1234567 } $postid { post

Module parse failed: Unexpected token ionic 3

◇◆丶佛笑我妖孽 提交于 2020-01-02 15:55:23
问题 After upgrading to the latest module of ionic and ionic-angular am getting this error. Here is my Package.json file after upgrading.. Here is my Package.json file after upgrading.. Runtime Error Module parse failed: Unexpected token (84:1254) You may need an appropriate loader to handle this file type. | HomelistPage = __decorate([ | Component({ | selector: 'page-homelist',template:/*ion-inline-start:"/Users/macbook/Downloads/studio/src/pages/home/homelist/homelist.html"*/`<ion-header>\n <ion

Firebase read/write permission for certain users

允我心安 提交于 2020-01-02 13:36:15
问题 I have a family, A, b, c, d , and A is the leader. We have an intruder, E . We only want b, c, d to read/write A's data. ALL OF THESE letters (b, c d,...) will be the UID's Here is what I have so far: Everyone is authenticated with email. People send requests to A to be allowed in his group. If he accepts, they can read/write to his. Design for database Firebase { "Leaders" : { "A" : { "ALLOWED" : { "b" : 0, "c" : 0, "d" : 0 }, "DATA" : { "blah blah1" : "content writable by bcd", "blah blah2"

query & where in Firebase (swift 3)

你。 提交于 2020-01-02 12:45:26
问题 How i can make query in firebase? On oracle sql the query would be "select * from users where username = "SomeUser" I need to do the same in Firebase, Swift 3 回答1: You need to use queryOrderedByChild and queryStartingAtValue . This should get you started in the right direction. queryStartingAtValue(username).queryEndingAtValue(username) let username = "SomeUser" FIRDatabase.database().reference.child("users").queryOrderedByChild("username").queryStartingAtValue(username).queryEndingAtValue

Create custom validation on Firebase Database Rules

风流意气都作罢 提交于 2020-01-02 10:15:13
问题 I want to create a chat application using firebase real time db, I already have my own server and my own authentication for my users and recipient. So basically what I want to do is: I want my server to able to generate room, and its room secret key, so only to people I share the secret key who can access the room, do read and write maybe the flow is like this 1. The server create a POST using REST API to this url curl -X PUT \ https://example-chat-92682.firebaseio.com/order-test.json \ -d '{