google-cloud-firestore

query firebase for documents that contain an array of length > 0

被刻印的时光 ゝ 提交于 2020-04-13 23:32:55
问题 Is it possible to query firebase for documents in a collection where the number of elements in an array of a particular field is greater than 0 For my example, each document has-a field called 'people', which contains an array of integers (or the array is empty). My search always return 0 documents, but I have documents that I can see when I search in the firestore database admin panel. import * as admin from 'firebase-admin'; import * as functions from 'firebase-functions'; admin

query firebase for documents that contain an array of length > 0

杀马特。学长 韩版系。学妹 提交于 2020-04-13 23:22:08
问题 Is it possible to query firebase for documents in a collection where the number of elements in an array of a particular field is greater than 0 For my example, each document has-a field called 'people', which contains an array of integers (or the array is empty). My search always return 0 documents, but I have documents that I can see when I search in the firestore database admin panel. import * as admin from 'firebase-admin'; import * as functions from 'firebase-functions'; admin

Does Firestore have internal mechanism to protect app from excessive $ charge from DDOS requests?

瘦欲@ 提交于 2020-04-13 17:04:31
问题 I was wondering if Firestore has internal mechanism to block requests similar to DDOS to prevent surprise surge in costs, or has a feature for owners to put limits on max requests/charges. For instance, assume that there is a collection in Firestore which is accessible as long as a user is logged in in my application. If an attacker creates around 100 user accounts, and writes a script which gradually and continuously access one entry from the collection with around 10~50tps each from

Does Firestore have internal mechanism to protect app from excessive $ charge from DDOS requests?

自古美人都是妖i 提交于 2020-04-13 17:04:23
问题 I was wondering if Firestore has internal mechanism to block requests similar to DDOS to prevent surprise surge in costs, or has a feature for owners to put limits on max requests/charges. For instance, assume that there is a collection in Firestore which is accessible as long as a user is logged in in my application. If an attacker creates around 100 user accounts, and writes a script which gradually and continuously access one entry from the collection with around 10~50tps each from

firebase cloud firestore pricing on batch operations

﹥>﹥吖頭↗ 提交于 2020-04-12 16:59:09
问题 https://firebase.google.com/docs/firestore/manage-data/transactions If we use the batch API to write something to firestore, is it going to be counted as a single write operation on pricing > 回答1: No. You are still charged for each individual document write. 来源: https://stackoverflow.com/questions/48435979/firebase-cloud-firestore-pricing-on-batch-operations

Declaring a function in Firestore rules

六月ゝ 毕业季﹏ 提交于 2020-04-11 18:10:31
问题 Here is a problem I am facing now with the Firestore security rules. First of all here is an example of data structure I have in my firestore database: userProfiles/userId/userData companies/companyId/companyData Looks pretty simple. Each userData includes and array named companies which includes all companyIds which this user has access to. Now I need to write rules to allow read companyData only if companyId is in particular user info companies list. Here are the rules which work for me:

Flutter Upload batch of images and get all those URLs to store in Firestore

偶尔善良 提交于 2020-04-11 04:02:07
问题 I'm trying to upload n number of photos to Firebase Storage and save those URLs in an array inside Firestore, but I am not able to get the downloadURL() or I do not know where to find it rather. I've checked other answers but those were for single files, I'm trying to upload a batch and store the URLs together instead of uploading on and storing the URL to Firestore and so on and so forth... CODE: _uploadImages(String userID, String productID, List<File> images, Function onSuccess(List<String

How to connect Dialogflow to Cloud Firestore via the Inline Editor in Dialogflow?

孤街醉人 提交于 2020-04-11 02:14:11
问题 I have a Cloud Firestore database that stores the number of inhabitants of all cities in England in 2017. Then I have a Dialogflow. Whenever I tell the name of a city to Dialogflow, I want it to get the number of inhabitants in that city from Firestore and return it to Dialogflow. Specifically, I want to implement this via the Inline Editor. Question : What lines of code do I need to add to the code below in order to make this happen? So here is the code that I write in the Inline Editor in

How do you mock Firebase Firestore methods using Jest?

浪尽此生 提交于 2020-04-10 12:01:29
问题 I have a series of functions, each performing various firestore interactions. How do I use Jest to mock these firestore calls? I would like to avoid using a library. When I use jest.mock("firebase/app") and jest.mock("firebase/firestore") and other variations, I either get null TypeErrors, or errors indicating I am still referencing the actual import and not the mock: Error: ... make sure you call initializeApp() . For example, a simple function I want to test: import firebase from "firebase

How do you mock Firebase Firestore methods using Jest?

南笙酒味 提交于 2020-04-10 11:59:36
问题 I have a series of functions, each performing various firestore interactions. How do I use Jest to mock these firestore calls? I would like to avoid using a library. When I use jest.mock("firebase/app") and jest.mock("firebase/firestore") and other variations, I either get null TypeErrors, or errors indicating I am still referencing the actual import and not the mock: Error: ... make sure you call initializeApp() . For example, a simple function I want to test: import firebase from "firebase