google-cloud-firestore

When i add orderBy app is not working in firestore

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-05 09:27:22
问题 Uncaught Error in onSnapshot: Error: The query requires an index. You can create it here at new FirestoreError (index.cjs.js:352) at JsonProtoSerializer.push../node_modules/@firebase/firestore/dist/index.cjs.js.JsonProtoSerializer.fromRpcStatus (index.cjs.js:5862) at JsonProtoSerializer.push../node_modules/@firebase/firestore/dist/index.cjs.js.JsonProtoSerializer.fromWatchChange (index.cjs.js:6359) at PersistentListenStream.push../node_modules/@firebase/firestore/dist/index.cjs.js

Firebase Security Rules Regex in Path

眉间皱痕 提交于 2021-02-05 09:27:08
问题 I have security rule write like this : /databases/{database}/documents { match /collection_COUNTRY_EN/{docId} { allow.... } match /collection_COUNTRY_ES/{docId} { allow... } } Where the rule are identical to all the country. Is there a way to implement regex in the match /path to have the same rule for all the collection that start with something and end with a country code ? Or does i have to structure my data in a different way ? Thanks for your time. 回答1: Security rules do not support

Receiver:null error when trying to save form using globalKey

萝らか妹 提交于 2021-02-05 09:22:43
问题 I'm following this https://medium.com/@c_innovative/simple-firebase-login-flow-in-flutter-6f44c2b5c58a tutorial and i am having some trouble with getting the login in to work. I have already connected my app to firebase and enabled email and password authentication on firebase console! I have tried entering the key argument into the TextFormfield but so far im unable to do so. class LoginPage extends StatefulWidget { @override State<StatefulWidget> createState() { return _LoginPageState(); }

Receiver:null error when trying to save form using globalKey

这一生的挚爱 提交于 2021-02-05 09:22:05
问题 I'm following this https://medium.com/@c_innovative/simple-firebase-login-flow-in-flutter-6f44c2b5c58a tutorial and i am having some trouble with getting the login in to work. I have already connected my app to firebase and enabled email and password authentication on firebase console! I have tried entering the key argument into the TextFormfield but so far im unable to do so. class LoginPage extends StatefulWidget { @override State<StatefulWidget> createState() { return _LoginPageState(); }

How can we create an array in array in Firestore?

爱⌒轻易说出口 提交于 2021-02-05 09:18:50
问题 I need to add array in an array-like I am creating you can see in the image I need to add 2 arrays in member. I need to save uid+name. but there is no option of the array just string, number, boolean etc. 回答1: How can we create an array in array in Firestore? You cannot. There is no way you can add an array within another array. The array is not a supported data type when it comes to array values. You can add an array that can contain strings, numbers, booleans, maps, timestamps, geopoints,

Your Cloud Firestore database has insecure: any user can read your entire database

放肆的年华 提交于 2021-02-05 09:14:09
问题 Building an app, using Firestore database for its content. Rules are: service cloud.firestore { match /databases/{database}/documents { // Allow public read access, but only content owners can write match /{document=**} { allow read: if true allow write: if request.auth.uid == request.resource.data.author_uid } } } As the warning says, I have allow read just set to true , which I understand, is a problem. How do I make it so my Flutter app can read the contents of my Firestore database, but

How to avoid race condition?

独自空忆成欢 提交于 2021-02-05 08:59:05
问题 I am make random 1:1 chat app with Flutter and Firestore. But I have race condition when I am connect second user to chat. This my client app code for add second user to Firestore (first user is already add to Firestore document): await chatRoomReference.setData({ ‘secondUserUID': uid, }); When second user tap to chat I am remove option to enter this chatroom from all client UI. But is possible that if third user tap to chat at same time (before UI get update from stream) he will also be add

How to refresh data in a Firestore Paging Adapter using Swipe Refresh Layout

蓝咒 提交于 2021-02-05 08:58:26
问题 I am building an app that i would like to fetch data from Firestore and display it in recyclerview as the user scrolls. I am using FirestorePagingAdapter as described here: https://github.com/firebase/FirebaseUI-Android/tree/master/firestore#using-the-firestorepagingadapter. This adapter does not listen for realtime changes in the database, how do I manually force a refresh using swipeRefreshLayout? 回答1: The FirestorePagingAdapter will load the data fresh from the database whenever it shows a

Firebase: flutter want to get a null value

女生的网名这么多〃 提交于 2021-02-05 08:54:07
问题 I want to get data that is null in a Firebase database stream: Firestore.instance .collection('resep') .where("email", isEqualTo: null) .snapshots(), I want to get email data that is null 回答1: From the documentation: where(dynamic field, { dynamic isEqualTo, dynamic isLessThan, dynamic isLessThanOrEqualTo, dynamic isGreaterThan, dynamic isGreaterThanOrEqualTo, dynamic arrayContains, bool isNull }) → Query Creates and returns a new Query with additional filter on specified field. field refers

How to save textarea multiline text to Cloud Firestore?

China☆狼群 提交于 2021-02-05 08:45:17
问题 I have this textArea input field for blogPost text content that may contain multiline text, like: This is paragraph one. (empty line) This is paragraph two. I will display it (when loading the blogPosts in my App) inside a <p> tag with white-space: pre-wrap; How should I save this to Cloud Firestore? What I've got so far: I'm thinking about saving as JSON.stringify(textareaValue); How can I do this? Any better options? 回答1: Cloud Firestore will store exactly what you send it. If you need the