google-cloud-firestore

How can I query firestore by document snapshot updateTime?

醉酒当歌 提交于 2021-02-05 05:23:23
问题 Is it possible to query firestore documents by updateTime . The field that is available from the document snapshot as doc.updateTime and use it in a where query? I am using the node.js sdk. 回答1: As far as I know there is no way to query on the metadata that Firestore automatically maintains. If you need to query the last update date, you will need to add a field with that value to the document's data. 回答2: I really need to query Firebase on document _updateTime, so I wrote a function that

Firebase Cloud Firestore restrict user access (Banking Application)

狂风中的少年 提交于 2021-02-04 21:51:43
问题 I am working on a banking app using firebase cloud firestore. I have already set the rules like so: // Allow read/write access on all documents to any user signed in to the application service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if request.auth.uid != null; } } } My database is structured like this: /consumers/{consumer_id}/transactions/{transaction_id} the {consumer_id} will contain the account balance for that consumer along

How to include Source Cache in cloud firestore realtime update in MVVM architecture android

早过忘川 提交于 2021-02-04 21:50:22
问题 In my app i am using android MVVM architecture, so for retrieving data from cloud firestore i am using layers so i create one more class ( FirebaseQueryLiveData ) for getting result from firestore. So with my code i am getting the realtime update but not able to add the Cache Source feature of firestore.I want to enable offline mode by adding cache soure. How to add it. ProductViewModel.java public class ProductViewModel extends AndroidViewModel { private FirebaseFirestore db =

Android Firebase : Update/Add record in Nested Array data

泄露秘密 提交于 2021-02-04 19:10:30
问题 I am stuck in one case of firebase operation in android. My Requirement : I have table Named : "Values" This value table contains following type of data. { "menu": [ { "category": "cocktails", "product": [ { "id": "123", "name": "test1" }, { "id": "456", "name": "test2" } ] }, { "category": "vodka", "product": [ { "id": "789", "name": "test3" }, { "id": "901", "name": "test4" } ] } ] } Now, I want to update id : 123 with name = "test5" , How to update this nested array object in firebase

Allow unregistered users to query Firestore to check if an E-Mail already exists

只谈情不闲聊 提交于 2021-02-04 08:36:45
问题 Right now, in my Firestore rules only registered users have read / write access to my project. However, I also want to verify in my registration process if an E-Mail already exists, which means also anonymous user have access to my "users" data. I am unsure how this is compliant from a security perspective. Should I create something like a "emails" collection and duplicate all E-Mail addresses here and allow anonymous users to query this? 回答1: Yup, that is indeed the typical approach.

How to update elements in arrays of maps in Firestore?

…衆ロ難τιáo~ 提交于 2021-02-04 08:28:52
问题 I have and Android App (java) that accesses firestore documents that comprise of an array field as shown: { cards: [ { reference: "", response: { text: "", title: "", }, timestamp: "" }, { reference: "", response: { text: "", title: "", }, timestamp: "" }, .... and so on I would like to update specific fields of each array element, like "response" : "text" and "response" : "title". What is the best way to achieve this? I have read in several places that arrays cannot be updated at element

Should a Firestore client be created per a request with Google App Engine?

感情迁移 提交于 2021-02-04 08:00:34
问题 I'm confused on how to approach this. It seems to be that GAE wants every client library to use a context.Context scoped to a http.Request. I previously have experience doing something like this: main.go type server struct { db *firestore.Client } func main() { // Setup server s := &server{db: NewFirestoreClient()} // Setup Router http.HandleFunc("/people", s.peopleHandler()) // Starts the server to receive requests appengine.Main() } func (s *server) peopleHandler() http.HandlerFunc { //

Is there any way to give everyone access to firestore database, but only via app?

梦想与她 提交于 2021-01-30 02:39:18
问题 I am creating Android application with Firestore. My app does not require authentication. Is there any security rule to allows everyone read & write to firestore, but only via my app? I have tried to find some rules, but each of them based on authentication. Thank you for your help! 回答1: No, you can't limit access to your Cloud Firestore only to your application. Since your application needs to know all the details that are needed to access the database, a malicious user can take those

Is there any way to give everyone access to firestore database, but only via app?

不羁岁月 提交于 2021-01-30 02:35:49
问题 I am creating Android application with Firestore. My app does not require authentication. Is there any security rule to allows everyone read & write to firestore, but only via my app? I have tried to find some rules, but each of them based on authentication. Thank you for your help! 回答1: No, you can't limit access to your Cloud Firestore only to your application. Since your application needs to know all the details that are needed to access the database, a malicious user can take those

firebasehosting.googleapis.com/network/active_connections: No such file or directory

僤鯓⒐⒋嵵緔 提交于 2021-01-29 22:38:24
问题 According to firebasedatabase metrics firebasedatabase Metrics from Firebase. Launch stages of these metrics: BETA GA The following metric type names must be prefixed with firebasedatabase.googleapis.com/. That prefix has been omitted from the entries in the table. Follow its guidance I tried reached it from gshell and I got 来源: https://stackoverflow.com/questions/61551885/firebasehosting-googleapis-com-network-active-connections-no-such-file-or-direc