google-cloud-firestore

Firebase firestore timestamp based security rules

Deadly 提交于 2021-02-19 05:32:18
问题 On my client side I am creating a document with one of the fields "createdDate" below is a payload from the firestore simulator { "__name__": "/databases/(default)/documents/billing/aaaa", "data": { "createdDate": 1529237500239, "createdDateTimeFormat": "2018-06-12T07:00:00.000Z" } } I tried to set the security rule to make sure the "createdDate" is not in the future. service cloud.firestore { match /databases/{database}/documents { match /billing/{userId}{ allow create: if (request.resource

What is the performance cost of an onSnapshot in firestore?

Deadly 提交于 2021-02-19 03:56:27
问题 I am designing an app that contains (a lot of) documents which are shared to (possibly many) groups. I need to understand how document changes are pushed from the server to the client in order to build my data model. Are all changes to the database pushed to the clients (with minimal data) and clients download what has been registered with onSnapshot ? Is there a filter on the remote server that is updated and only relevant data is pushed to the client ? In model (1), the cost of adding many

Where to store the JSON file which will be referenced for the environment variable in asp.net hosted on Azure

纵饮孤独 提交于 2021-02-19 02:39:43
问题 I have created a Web Service using ASP.NET and will be storing data in Firestore. Hence, I will need to set the GOOGLE_APPLICATION_CREDENTIALS environment variable referring to a JSON file. This works locally on my machine, but it doesn't work when it's published to Azure. The problem is I couldn't find the JSON file to locate the file path, I have double checked my local project folder whether the JSON file is in there before publishing. May I know where is the best place to store my JSON

Cloud Firestore - Dynamic Querying

独自空忆成欢 提交于 2021-02-19 01:32:05
问题 I have a Collection in Cloud Firestore that has a certain number of items, let's call it Collection "X". This number of items will constantly be changing. At any given time, I want to listen for the number of items in this Collection and create several whereEqualto() calls on a Query object that is based on another 'Collection', let's call it "Y": Query queryStore = FirebaseFirestore.getInstance() .collection("Y") .whereEqualTo(USER_ID_LABEL, "item 1 from X") .whereEqualTo(USER_ID_LABEL,

How to use Google Cloud Firestore local emulator for python and for testing purpose

◇◆丶佛笑我妖孽 提交于 2021-02-18 22:50:00
问题 I tried to find out how to use firestore local emulator for python and for testing purpose. But I can not find out how-to document. Could somebody help me? 回答1: Welcome to SO :) The primary purpose of the Cloud Firestore Emulator (at the moment) seems to be to test security rules, as documented here. This section states: "The only SDK that currently supports the emulator is the Node.js SDK." Confusingly there are also these Ruby docs for the Google Cloud Client Libraries. The same thing does

How to use Google Cloud Firestore local emulator for python and for testing purpose

孤街浪徒 提交于 2021-02-18 22:43:56
问题 I tried to find out how to use firestore local emulator for python and for testing purpose. But I can not find out how-to document. Could somebody help me? 回答1: Welcome to SO :) The primary purpose of the Cloud Firestore Emulator (at the moment) seems to be to test security rules, as documented here. This section states: "The only SDK that currently supports the emulator is the Node.js SDK." Confusingly there are also these Ruby docs for the Google Cloud Client Libraries. The same thing does

Flutter :[cloud_firestore/unknown] NoSuchMethodError: invalid member on null: 'includeMetadataChanges' (Flutter Web)

烂漫一生 提交于 2021-02-18 22:20:06
问题 I am trying to fetch data from Friebase-firestore and then convert it to model, I used the same code and approach to another project (web project) ,it works fine , but with this project it doesn't work ,I don't know why. I upgrade flutter version, run Flutter doctor , and nothing wrong with the environment setup. here is the code : class dbService{ static final CollectionReference myCollection = FirebaseFirestore.instance.collection('myCollection'); static Future<myModel> getMyInfo() async{

Vuexfire bindFirebaseRef with pagination infinite scroll

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-18 17:54:45
问题 Question : How can I add pagination (infinite scroll) to my binded Firestore VuexFire reference without re-querying previously retrieved (and binded) results? Background : I am currently using VuexFire firestore binding to fill a timeline for most upvoted posts, as an action, in my Vuex store like this: fillTimeLine: firebaseAction( ({ bindFirebaseRef }) => { bindFirebaseRef( 'timelineResults', db .collection('POSTS') .orderBy('combined_vote_score', 'desc') .limit(30) ) }) This will retrieve

Flutter app crashes on concurrent transactions performed on cloud Firestore

允我心安 提交于 2021-02-18 17:49:36
问题 I am trying to develop an app where multiple users log in and completes a poll concurrently. In this, as soon as user submits the answer the transaction is ran to increment the counter for given answer try { DocumentSnapshot freshsnap = await tx.get(reff); try { await tx.update(reff, <String, dynamic>{ '$i': freshsnap['$i'] + 1, }); } catch (error) { print("Error" + error.code); } } catch (error) { if (error is PlatformException && error.code == 'Error performing transaction') { // await tx

Flutter app crashes on concurrent transactions performed on cloud Firestore

北慕城南 提交于 2021-02-18 17:49:31
问题 I am trying to develop an app where multiple users log in and completes a poll concurrently. In this, as soon as user submits the answer the transaction is ran to increment the counter for given answer try { DocumentSnapshot freshsnap = await tx.get(reff); try { await tx.update(reff, <String, dynamic>{ '$i': freshsnap['$i'] + 1, }); } catch (error) { print("Error" + error.code); } } catch (error) { if (error is PlatformException && error.code == 'Error performing transaction') { // await tx