google-cloud-firestore

Is there any way to profile firestore database?

只愿长相守 提交于 2020-01-19 16:16:38
问题 I am getting very high counts of Entity Writes in my firestore database. Write permission in most of the paths are restricted, done from back-end server using admin SDK. Only a very few paths have write access- specifically only to the users who are (authenticated & registered & joined and approved in a specific group), so even though the ways to abuse are apparently thin, yet hard to specifically identify. Only way I see- is to execute Cloud Functions on every write, and have the function

Is there any way to profile firestore database?

江枫思渺然 提交于 2020-01-19 16:16:35
问题 I am getting very high counts of Entity Writes in my firestore database. Write permission in most of the paths are restricted, done from back-end server using admin SDK. Only a very few paths have write access- specifically only to the users who are (authenticated & registered & joined and approved in a specific group), so even though the ways to abuse are apparently thin, yet hard to specifically identify. Only way I see- is to execute Cloud Functions on every write, and have the function

Is there any way to profile firestore database?

一世执手 提交于 2020-01-19 16:15:49
问题 I am getting very high counts of Entity Writes in my firestore database. Write permission in most of the paths are restricted, done from back-end server using admin SDK. Only a very few paths have write access- specifically only to the users who are (authenticated & registered & joined and approved in a specific group), so even though the ways to abuse are apparently thin, yet hard to specifically identify. Only way I see- is to execute Cloud Functions on every write, and have the function

How to use Admin SDK with limited privileges on Firestore?

佐手、 提交于 2020-01-19 05:37:45
问题 I have some trouble with Cloud function and firestore rules. I would like use cloud function with limited privilèges on Firestore and give only has access as defined in the Security Rules It's working without problem on RTDB but not on Firestore. I have try with this rules service cloud.firestore { match /databases/{database}/documents { match /init/{ID=**} { allow read, write: if true; } match /test/{ID=**} { allow read, write: if false; } } } And this const admin = require('firebase-admin')

Firestore iOS OR query (whereField(“X”, in: [“Y”, “Z”])

╄→гoц情女王★ 提交于 2020-01-16 20:19:47
问题 According to the firestore documentation (make sure to select Swift for the code examples), Firestore iOS SDK allows OR queries. There is no OR operator, but the query syntax ref.whereField("X", in: ["Y", "Z"]) should fulfil the same purpose. However, although I'm using the latest version of Firestore for iOS (1.2.1) and FirebaseCore (5.4.1) this syntax does not seem to be supported. What am I doing wrong? 回答1: The whereField(_:in:) query operator was introduced in version 6.12 of the

Firestore iOS OR query (whereField(“X”, in: [“Y”, “Z”])

China☆狼群 提交于 2020-01-16 20:19:06
问题 According to the firestore documentation (make sure to select Swift for the code examples), Firestore iOS SDK allows OR queries. There is no OR operator, but the query syntax ref.whereField("X", in: ["Y", "Z"]) should fulfil the same purpose. However, although I'm using the latest version of Firestore for iOS (1.2.1) and FirebaseCore (5.4.1) this syntax does not seem to be supported. What am I doing wrong? 回答1: The whereField(_:in:) query operator was introduced in version 6.12 of the

Firestore replicating a SQL Join for noSQL and Flutter

南楼画角 提交于 2020-01-16 19:49:32
问题 I realise there is many questions in regards to replicating joins with NoSql document databases such as FireStore, however i'm unable to find a thorough solution utilising Dart/Flutter with FireStore. I have done some research i feel that in the following example i would be looking for a 'many to many' relationship (please correct me if this is wrong) as there may be a future need to look at all profiles as well as all connections. In firebase, i have two root level collections (profile &

Firestore, how to combine more than 2 references to the collection at the same time

☆樱花仙子☆ 提交于 2020-01-16 19:01:10
问题 I use the method described in Firestore how to get the collection value from another collection document id is referenced but i've to combinate two reference document in one time but in other collections like: cash.models.ts: import { DocumentReference } from "@angular/fire/firestore"; export class Cash { // .collection('contactors') id: string; person: DocumentReference<Workers>; contactor: DocumentReference<Contactors>; nr_dokumentu: string; kwota: number; data: string; } export class

How to update a collection using cloud function?

烂漫一生 提交于 2020-01-16 18:56:52
问题 I would like to update the score using a cloud function I've tried this so far exports.rate = functions.https.onRequest((request, response) => { admin .firestore() .collection() .where("index", "==", request.index) .get() .then(snap => { snap.forEach(x => { const newRating = x.data().score + request.value; firebase .firestore() .collection() .doc(x.id) .update({ score: newRating }); }); }); }); 回答1: The following should work: exports.rate = functions.https.onRequest((request, response) => {

How to update a collection using cloud function?

假如想象 提交于 2020-01-16 18:55:32
问题 I would like to update the score using a cloud function I've tried this so far exports.rate = functions.https.onRequest((request, response) => { admin .firestore() .collection() .where("index", "==", request.index) .get() .then(snap => { snap.forEach(x => { const newRating = x.data().score + request.value; firebase .firestore() .collection() .doc(x.id) .update({ score: newRating }); }); }); }); 回答1: The following should work: exports.rate = functions.https.onRequest((request, response) => {