google-cloud-firestore

How to solve error Paths must not contain // in them. Firestore flutter error

安稳与你 提交于 2020-07-22 08:28:23
问题 I am not including // in my path.But still i am getting error from firestore that Paths must not contain // in them onPressed: (){ opencheckout(); setState(() { _firestore.collection('userss').document(uid) .collection('OrdersSuccess').add({ "name":product.name, "original":product.original, "Quantity":product.Quantity, "image":product.image, }); }); }; Debug console Message E/MethodChannel#plugins.flutter.io/cloud_firestore(12572): java.lang.IllegalArgumentException: Invalid path (userss/

How to make query spot only the some value in a Map inside an Array in flutter (dart)?

懵懂的女人 提交于 2020-07-22 06:30:06
问题 I am working on this project where I have to put data in maps inside in array for example: [{Rate: 1.3, Title: "Test",...}] What I would like to do to find documents which has maps inside their array with rating 1.3 and above without fetching all arrays and filtering it internally I have tried to this Firestore.instance .collection("profiles") .where("questions", arrayContains: {"Rate": 1.3}) .getDocuments(source: Source.serverAndCache) this code actually requires me to put all map data so it

FirebaseError: invalid stream token

≯℡__Kan透↙ 提交于 2020-07-22 05:21:50
问题 After changing a cloud function I’m getting the following error for any write operation to my database: FirebaseError: invalid stream token . After changing the functions back and redeploying, the error still remains. I was unable to find any reference to this error in Firebase docs. Anyone know what this is about? 回答1: I "solved" this. For anyone else who runs into the error: > rm package-lock.json > rm -rf node-modules/ > npm install Would still be nice to have a reference to this somewhere

FirebaseError: invalid stream token

狂风中的少年 提交于 2020-07-22 05:21:33
问题 After changing a cloud function I’m getting the following error for any write operation to my database: FirebaseError: invalid stream token . After changing the functions back and redeploying, the error still remains. I was unable to find any reference to this error in Firebase docs. Anyone know what this is about? 回答1: I "solved" this. For anyone else who runs into the error: > rm package-lock.json > rm -rf node-modules/ > npm install Would still be nice to have a reference to this somewhere

Cloud Firestore whereNotEqual

本小妞迷上赌 提交于 2020-07-22 03:56:32
问题 Does Firestore support something like whereNotEqual ? For example, I need to get exact documents where key "xyz" is missing. In Firebase realtime db, we could get it by calling *.equalTo(null) . Thanks. 回答1: Firestore does not support a direct equivalent of != . The supported query operators are <, <=, ==, >, or >= so there's no "whereNotEqual". You can test if a field exists at all, because all filters and order bys implicitly create a filter on whether or not a field exists. For example, in

How to populate a spinner with the result of a Firestore query?

这一生的挚爱 提交于 2020-07-21 14:03:58
问题 I am creating a spinner which will show the subject name. The subject names are stored in my Firestore database as follows: subjects (collection) | |--- SUB01 (document) | | | |--- name : "Android" | |--- SUB02 | | | |--- name : "Java" I could fetch the result to an RecyclerView but unable to help myself to do so for spinner. 回答1: To solve this, please use the following lines of code: FirebaseFirestore rootRef = FirebaseFirestore.getInstance(); CollectionReference subjectsRef = rootRef

Firestore - Query, then update

血红的双手。 提交于 2020-07-21 04:19:31
问题 I want to return an item with a specific ID and perform an update operation on it. My query gets the right result, but it won't let me update it. I tried following this tutorial: https://www.youtube.com/watch?v=mYyPbfpoZeM And read the documentation. Both didn't help. Other threads to the same topic are, well, different. I have a database of objects which have a unique ID stored as integer. I have an HTML form to get an ID as user input and the query below to retrieve the according object. I

How to add data from firestore to my spinner

你。 提交于 2020-07-20 04:23:44
问题 Login in the app is solely done by otp method. so first i retrieve the society in the which the mobile no. is registered. then i want to populate my spinner with all tower names of that society only. the structure of firestore form where society name is received is mobile |-----(mobile no.) | |----society:"name of society" | and the structure of the collection having the names of society tower_list |----(name of tower) | |-----name:"name of tower" | |-----society:"name of society" the main

AngularFirestore - Update query dynamically

允我心安 提交于 2020-07-20 03:42:20
问题 I have the following query: loadData(settings: any): Observable<any[]> { const ref = this.db.collection('data').ref .orderBy('simpleID', 'desc') .where('isVerified', '==', true) .limit(5); // Gender filter if (settings.includeMales && !settings.includeFemales) { ref.where('gender', '==', 'm'); } else if (!settings.includeMales && settings.includeFemales) { ref.where('gender', '==', 'f'); } return this.db.collection('confessions', ref => ref) .valueChanges(); I want to apply filters

Delete data from Firestore dynamically

懵懂的女人 提交于 2020-07-19 19:01:10
问题 I'm building a project with React & Redux & Firestore, I know how to delete/update/add etc.. But when I have 2 subcollections with dynamic field, I couldn't find any solution to delete it. If you look at the picture, I have the table ID and user ID, but the fields are 0, 1, 2 and so on. How can I delete a field from tableGuests? Maybe the structure is not good and could be better? guests > user id > userTables > table id > tableGuests which is an array. 回答1: How can I delete a field from