firebase-realtime-database

does the firebase database online editor ignore security rules

女生的网名这么多〃 提交于 2019-12-29 09:08:09
问题 I have rules set up that ensure a foreign key like constraint: when I put data at a certain path, the key is validated to exist at another node. Rule snippet: "app": { "freebies": { "$provider_id": { ".validate": "newData.parent().parent().parent().child('app').child('providers').child($provider_id).val() != null" } } } If I run a simulation with these params Write to /app/freebies width data: {"totally_fake": 1} This fails, which is CORRECT. On the other hand, if I just go to the online

Can I get firebase analytics data using query?

吃可爱长大的小学妹 提交于 2019-12-29 08:41:29
问题 How can I get firebase analytics data using HTTP request or api? I want to show firebase analytics data on my website 回答1: You can't directly do this from http or api. But you need to export to BigQuery and there you can query the data. I am not much aware of hoe BigQuery works and how you can fetch and show data on websites but you can not do this in your free plan. You can export war analytics data to BigQuery in BLAZE plan. And then you can query from the BigQuery database. 回答2: Google

Can I get firebase analytics data using query?

老子叫甜甜 提交于 2019-12-29 08:41:25
问题 How can I get firebase analytics data using HTTP request or api? I want to show firebase analytics data on my website 回答1: You can't directly do this from http or api. But you need to export to BigQuery and there you can query the data. I am not much aware of hoe BigQuery works and how you can fetch and show data on websites but you can not do this in your free plan. You can export war analytics data to BigQuery in BLAZE plan. And then you can query from the BigQuery database. 回答2: Google

Firebase v3 Query by Grandchild

雨燕双飞 提交于 2019-12-29 08:19:07
问题 When registering new email/password type users, I need to make user that the displayName that they enter does not already exist in my Realtime Database before calling .createUserWithEmailAndPassword . So I need a query. I need to get a list of all displayName 's in my users branch. I am confused as to how to gather this for each user which is denoted by each users auth.uid. What would the retrieval look like? I am thinking something like: firebase.database().ref('users/' + allUserIds).equalTo

Firebase v3 Query by Grandchild

旧城冷巷雨未停 提交于 2019-12-29 08:19:04
问题 When registering new email/password type users, I need to make user that the displayName that they enter does not already exist in my Realtime Database before calling .createUserWithEmailAndPassword . So I need a query. I need to get a list of all displayName 's in my users branch. I am confused as to how to gather this for each user which is denoted by each users auth.uid. What would the retrieval look like? I am thinking something like: firebase.database().ref('users/' + allUserIds).equalTo

Keep data from the Firebase Realtime Database always in sync

若如初见. 提交于 2019-12-29 08:08:12
问题 I'm currently re-working an app of mine which updates it's internal SQLite database by fetching raw data from an website, not an official API. As this is quite error-prone I'd like to move the data processing out of the client into an backend server. The idea is to have a script running on the server multiple times a day - similar to the client behaviour before - and storing the data in a Firebase Realtime Database. Then, all clients no longer have to process the data themselves but rather

How to add timestamp to every collection insert,update in Cloud Functions for firestore database

别说谁变了你拦得住时间么 提交于 2019-12-29 08:04:33
问题 I have a firestore collection called Posts I make an insert on the client side and it works. I want to add the createdAt and updatedAt fields to every insert in my posts collection firestore using firebase functions. 回答1: In order to add a createdAt timestamp to a Post record via a Cloud Function, do as follows: exports.postsCreatedDate = functions.firestore .document('Posts/{postId}') .onCreate((snap, context) => { return snap.ref.set( { createdAt: admin.firestore.FieldValue.serverTimestamp(

How to add timestamp to every collection insert,update in Cloud Functions for firestore database

佐手、 提交于 2019-12-29 08:02:07
问题 I have a firestore collection called Posts I make an insert on the client side and it works. I want to add the createdAt and updatedAt fields to every insert in my posts collection firestore using firebase functions. 回答1: In order to add a createdAt timestamp to a Post record via a Cloud Function, do as follows: exports.postsCreatedDate = functions.firestore .document('Posts/{postId}') .onCreate((snap, context) => { return snap.ref.set( { createdAt: admin.firestore.FieldValue.serverTimestamp(

How to protect firebase Cloud Function HTTP endpoint using authenticated id token and database rules?

故事扮演 提交于 2019-12-29 06:35:16
问题 admin.auth().verifyIdToken(tokenId) .then((decoded) => res.status(200).send(decoded)) I understand verifyIdToken() can verify a user id token from Firebase Authentication clients. However we need to protect our Cloud Function by making sure database queries are limited by the security rules defined for the database for the user identified in the token. Given that the admin SDK has unlimited access by default, how to I limit its access to just that of the authenticated user? 回答1: Take a look

How to detect internet connection with Firebase Database using Swift3?

巧了我就是萌 提交于 2019-12-29 06:25:55
问题 Can any one help me to detect internet connection with Firebase Database using Swift 3? I am using this function to download data from database. func loadData(){ Ref=FIRDatabase.database().reference() Handle = Ref?.child("Posts").queryOrdered(byChild: "Des").queryEqual(toValue: "11").observe(.childAdded ,with: { (snapshot) in if let post = snapshot.value as? [String : AnyObject] { let img = Posts() img.setValuesForKeys(post) self.myarray.append(img) self.tableView.reloadData() }else { } }) }