google-cloud-firestore

firebase security rule to allow admin users to read/write all other users creates a security breach?

元气小坏坏 提交于 2021-02-11 05:57:30
问题 I am using cloud Firestore database and I have 'users' collection on my root database and in it there are all the users documents (named as the uid) and inside it the data I collect. I wanted to allow users to only read/write to their own collections so I started my security rules with service cloud.firestore { match /databases/{database}/documents { // Allow only authenticated content owners access match /users/{userId}/{documents=**} { allow read, write: if request.auth.uid == userId } } }

firebase security rule to allow admin users to read/write all other users creates a security breach?

泪湿孤枕 提交于 2021-02-11 05:55:40
问题 I am using cloud Firestore database and I have 'users' collection on my root database and in it there are all the users documents (named as the uid) and inside it the data I collect. I wanted to allow users to only read/write to their own collections so I started my security rules with service cloud.firestore { match /databases/{database}/documents { // Allow only authenticated content owners access match /users/{userId}/{documents=**} { allow read, write: if request.auth.uid == userId } } }

Flutter Firebase global Auto Incremental value and retrieving in document field dart

[亡魂溺海] 提交于 2021-02-11 02:00:31
问题 I'm quite new to Firebase Flutter. I'm developing a mobile application to share books among others. In firebase firestore, I have 'users' collections which contain all the user data with unique id I have 'books' collection which contain all the book data with unique id created automatically Also I have 'global' collection with single document with one integer field called 'bookcount'. Users can can have many books. Now I want to create a another unique id field for book. idea is to have

Flutter Firebase global Auto Incremental value and retrieving in document field dart

吃可爱长大的小学妹 提交于 2021-02-11 01:55:23
问题 I'm quite new to Firebase Flutter. I'm developing a mobile application to share books among others. In firebase firestore, I have 'users' collections which contain all the user data with unique id I have 'books' collection which contain all the book data with unique id created automatically Also I have 'global' collection with single document with one integer field called 'bookcount'. Users can can have many books. Now I want to create a another unique id field for book. idea is to have

Firestore: How to add a document to a subcollection after updating parent

佐手、 提交于 2021-02-10 23:59:20
问题 I'm building out a quick API for an IOT type app. The structure is that I have a sensor document with latestValue1 and latestVoltage values. Each sensor document also has a collection of readings (an hourly log, let's say.) The Set function works fine to update latestValue1 and latestVoltage , but I'm struggling to work out how to create the readings collection and add a document to it- the code below gives me TypeError: document.collection is not a function app.put('/api/update/:item_id',

SQL like joins in Firestore

喜夏-厌秋 提交于 2021-02-10 22:41:06
问题 I have a collection called creditcards and a collection called ownedcreditcards in Cloud Firestore. I want to perform a query where I JOIN the two collections to find only the creditcards that exists in the creditcards -collection, and not in the ownedcreditcards . From my understanding SQL like JOINS does not exist in Firestore, and you have to retrieve the data in multiple queries. I am trying to call the getAll() -functions (which retrieves all the documents) on both my collections,

Can I limit number of reads/writes from user IP per minute/day in firestore?

拥有回忆 提交于 2021-02-10 20:31:53
问题 How can I limit number of reads/writes from one IP in firestore? P.S. I don't have any authentication in my app 回答1: Limiting any sort of access by IP address is not possible with Cloud Firestore. Instead, you should consider actually using some authentication, force requests through a backend you control, and perform per-user auditing from there. 来源: https://stackoverflow.com/questions/58647720/can-i-limit-number-of-reads-writes-from-user-ip-per-minute-day-in-firestore

Can I limit number of reads/writes from user IP per minute/day in firestore?

妖精的绣舞 提交于 2021-02-10 20:29:49
问题 How can I limit number of reads/writes from one IP in firestore? P.S. I don't have any authentication in my app 回答1: Limiting any sort of access by IP address is not possible with Cloud Firestore. Instead, you should consider actually using some authentication, force requests through a backend you control, and perform per-user auditing from there. 来源: https://stackoverflow.com/questions/58647720/can-i-limit-number-of-reads-writes-from-user-ip-per-minute-day-in-firestore

How to connect to a Firestore database with Ruby

孤街醉人 提交于 2021-02-10 20:26:20
问题 I'm trying to write and read to and from my Firestore database from a Ruby script, eventually from a Rails application. It seems like a trivial task but when I run a test script inside IRB it won't let me write or read data. I tried: successfully installed google-cloud-firestore gem downloaded JSON keyfile from within the Firestore console. security rules are set to public (read and write) require 'google/cloud/firestore' # => true # credentials cred = Google::Cloud::Firestore::Credentials

How to connect to a Firestore database with Ruby

a 夏天 提交于 2021-02-10 20:25:29
问题 I'm trying to write and read to and from my Firestore database from a Ruby script, eventually from a Rails application. It seems like a trivial task but when I run a test script inside IRB it won't let me write or read data. I tried: successfully installed google-cloud-firestore gem downloaded JSON keyfile from within the Firestore console. security rules are set to public (read and write) require 'google/cloud/firestore' # => true # credentials cred = Google::Cloud::Firestore::Credentials