google-cloud-firestore

Is Firestore Security Rule .hasAny(['A', 'B', 'C']) still available for use?

此生再无相见时 提交于 2020-05-26 08:04:31
问题 Can't seemed to use Firestore Security Rule .hasAny(). Is this method deprecated or no longer available? I am using it like /// Functions - NOT WORKING!!! /// function isTeamMember(teamId, userId) { return get(/databases/$(database)/documents/team_access_privilege/$(teamId)).data[userId].hasAny(['OWNER', 'ADMIN', 'STANDARD']) } The Firestore data is structured as such - team_access_privilege (COLLECTION) -- teamId (DOCUMENT) --- userId1 (KEY) : 'OWNER' (VALUE) --- userId2 (KEY) : 'ADMIN'

Is Firestore Security Rule .hasAny(['A', 'B', 'C']) still available for use?

旧街凉风 提交于 2020-05-26 08:04:31
问题 Can't seemed to use Firestore Security Rule .hasAny(). Is this method deprecated or no longer available? I am using it like /// Functions - NOT WORKING!!! /// function isTeamMember(teamId, userId) { return get(/databases/$(database)/documents/team_access_privilege/$(teamId)).data[userId].hasAny(['OWNER', 'ADMIN', 'STANDARD']) } The Firestore data is structured as such - team_access_privilege (COLLECTION) -- teamId (DOCUMENT) --- userId1 (KEY) : 'OWNER' (VALUE) --- userId2 (KEY) : 'ADMIN'

How to get random documents from Cloud Firestore in Dart (for Flutter)?

ⅰ亾dé卋堺 提交于 2020-05-26 07:23:31
问题 Lets say I have the following documents inside a Firestore collection: How can I randomly get one or more documents without having to download them all? By the way, I've already seen Dan McGrath's Answer, but he didn't specifically explain how to generate the auto-id for Flutter, also, I would love to see a complete example in Dart since his explanation was very generic. Thanks in advance! 回答1: According to Dan's answer, here's my current implementation. static const AUTO_ID_ALPHABET =

How to get random documents from Cloud Firestore in Dart (for Flutter)?

风流意气都作罢 提交于 2020-05-26 07:21:04
问题 Lets say I have the following documents inside a Firestore collection: How can I randomly get one or more documents without having to download them all? By the way, I've already seen Dan McGrath's Answer, but he didn't specifically explain how to generate the auto-id for Flutter, also, I would love to see a complete example in Dart since his explanation was very generic. Thanks in advance! 回答1: According to Dan's answer, here's my current implementation. static const AUTO_ID_ALPHABET =

In Cloud Firestore rules - How do I check if a key is null

雨燕双飞 提交于 2020-05-25 12:12:45
问题 In Cloud Firestore Rules - I have a document called task and I want to see if some data ( assignee field) is null / don't exists. I've tried: resource.data.assignee == null - Does not work (Error) !resource.data.hasAll(['assignee']) - Does not work (Error) From the documentation - it states that this indeed creates an error: // Error, key doesn't exist allow read: if resource.data.nonExistentKey == 'value'; 回答1: Reading the list comparisons of the Firestore Security rules documentation here,

Generating Swagger Docs in Firebase Cloud Functions project

自古美人都是妖i 提交于 2020-05-25 11:27:14
问题 Is it possible to generate Swagger Spec file from function comments in firebase cloud functions? If so, how can we do it? I see the cloud functions code to be more like serverless, so wondering if this is possible. 回答1: I haven't found an automatic way, but there are plenty of libraries to choose from. I'm using express and nodejs in my Firebase Function implementations, and for me, Swagger doc generation can be implemented via the following libraries: https://github.com/scottie1984/swagger

Generating Swagger Docs in Firebase Cloud Functions project

点点圈 提交于 2020-05-25 11:26:41
问题 Is it possible to generate Swagger Spec file from function comments in firebase cloud functions? If so, how can we do it? I see the cloud functions code to be more like serverless, so wondering if this is possible. 回答1: I haven't found an automatic way, but there are plenty of libraries to choose from. I'm using express and nodejs in my Firebase Function implementations, and for me, Swagger doc generation can be implemented via the following libraries: https://github.com/scottie1984/swagger

FirestoreAdapter not working to populate a Recycler View

匆匆过客 提交于 2020-05-24 07:31:31
问题 I'm a rookie with Android and decided to use Cloud Firestore as my db and a RecyclerView for populating a list in my MainActivity. I thought using Firebase-UI for Firestore would be super easy, but I can't figure out why nothing is populating in my RecyclerView. For reference, here is the Firebase UI page and here is the example code that I based my app off of. All I'm trying to do is populate a list of "Courses" (Course.java not displayed below since it's just a simple POJO with name, date,

FirestoreAdapter not working to populate a Recycler View

孤人 提交于 2020-05-24 07:31:09
问题 I'm a rookie with Android and decided to use Cloud Firestore as my db and a RecyclerView for populating a list in my MainActivity. I thought using Firebase-UI for Firestore would be super easy, but I can't figure out why nothing is populating in my RecyclerView. For reference, here is the Firebase UI page and here is the example code that I based my app off of. All I'm trying to do is populate a list of "Courses" (Course.java not displayed below since it's just a simple POJO with name, date,

Flutter - Your Cloud Firestore database has insecure rules

回眸只為那壹抹淺笑 提交于 2020-05-24 05:44:06
问题 I have a collection called users where I am checking if new users mobile no is present or not. If It is present then I am performing phone authentication for that user then storing uid as a field in document. If user is coming for the first time, he is not authenticated and I am performing read operation from users collection. Now every time I am getting Your Cloud Firestore database has insecure rules email from google. Below is the rule I am using. Please let me know how can I make it