google-cloud-firestore

I need to update a certain array entry of my Map in Firestore

烈酒焚心 提交于 2021-02-11 15:40:46
问题 I want to update a product of my products array. I have an array of products in a collection products[{ - 0 productPrice: 123 - 1 productPrice: 432 }] In my code I have passed the position of the element I want to update in that array of products suspend fun updateProductPrice(position:Int,shopId: String,price: Int): Resource<Unit> { FirebaseFirestore.getInstance().collection("shops").document(shopId).update("products"[position]) //here I need to get productPrice and update its value to the

Want to pass the total price in the bottom navigation bar in flutter

試著忘記壹切 提交于 2021-02-11 15:21:17
问题 How can i show the total amount in the bottom navigation bar... The app uses firebase backend... I have a filed in my database name total price of each item... Now I want to fetch the total price of each item and then add it and display in the bottom navigation bar.. I have attach my firebase backend screen shot.. what i need is to get all the value of the field 'total' add it up and show it in the bottom bar below the Total which is hardcoded as 999 currently section... It would be helpful

Firebase firestore server timestamp without importing all of firebase to my web project?

一个人想着一个人 提交于 2021-02-11 15:14:02
问题 I am using Firebase in a React web app and I need to use firebase.firestore.FieldValue.serverTimestamp() and some other methods. However to get a firebase reference I import import * as firebase from "firebase"; Doing this import gives me the following console warning: It looks like you're using the development build of the Firebase JS SDK. When deploying Firebase apps to production, it is advisable to only import the individual SDK components you intend to use. For the module builds, these

how to fix firebase error UISearchdisplayController is no longer supported. Migrate to UISearchController.?

大城市里の小女人 提交于 2021-02-11 14:54:37
问题 Xcode 11.3 version Xamarin.iOS version: 13.10.0.17 (Visual Studio Community) Xamarin.Firebase.iOS.Auth version: 5.0.4.1 Xamarin.Firebase.iOS.CloudFirestore version: 0.13.3 Xamarin.Firebase.iOS.Core version: 5.1.8 I have noticed this crash recently, only with app store distributed version [Test flight build] The two crazy things are for me : I’m not using “UISearchDisplayController” but the required new “UISearchController”. Why is not crashing in local, but only on the AppStore version ? Same

Firestore Security Rules Permission Issue

限于喜欢 提交于 2021-02-11 14:52:38
问题 I have documents in firestore collection called 'inventories' of the following structure: { creator: string, images: string[], } the creator field is the uid of the user who created the document. In my firestore rules section I have the following rules: service cloud.firestore { match /databases/{database}/documents { match /inventories/{inventoryid} { allow read, write: if request.auth.id == resource.data.creator; } } } In my ionic application I do the following: this.inventoryCollection =

How to get documents without metadata from firestore

怎甘沉沦 提交于 2021-02-11 14:51:13
问题 In firestore there are collections cities , posts and users . posts have documents with reference to one user and a city , I wanted to retrieve all data from all posts and wrote a query: firestore.collection('posts') .get() .then(snapshot => { snapshot.docs.forEach(post => { console.log(post.data()) }); }); although I have only one document in posts, in my console I get thousands of lines of data, all I need is something like this: postId: { city: "city_name", user: { name: "Name", lastName:

How to get documents without metadata from firestore

会有一股神秘感。 提交于 2021-02-11 14:50:18
问题 In firestore there are collections cities , posts and users . posts have documents with reference to one user and a city , I wanted to retrieve all data from all posts and wrote a query: firestore.collection('posts') .get() .then(snapshot => { snapshot.docs.forEach(post => { console.log(post.data()) }); }); although I have only one document in posts, in my console I get thousands of lines of data, all I need is something like this: postId: { city: "city_name", user: { name: "Name", lastName:

How do I handle my data model class to get Firebase Firestore data into recyclerView?

寵の児 提交于 2021-02-11 14:34:05
问题 I have a Firestore database like this: I want to access each of the different symptom data's i.e. "Anxiety_data" and its children which consists of timestamps, and then a dictionary, and place them into a RecyclerView using FirebaseUI FirebaseRecyclerViewAdapter I have this model class: public class EntryDataModel { private String timestamp, symptom, severity, comment; public EntryDataModel() {} public EntryDataModel(String timestamp, String symptom, String severity, String comment) { this

same Firestore realtime database for client and user

妖精的绣舞 提交于 2021-02-11 14:23:13
问题 I want to make a Flutter app for showing shop details. I stored data in the Firestore real-time database. It's working perfectly. What I want to do now is make another app for the owner, then he can change data in Firestore and also send push notifications to shop app users. Is this possible? It would be helpful If you have any tutorials or videos.I haven't tried cloud functions because they need a credit card, Which I don't have. 来源: https://stackoverflow.com/questions/65352286/same

Firestore query single document

给你一囗甜甜゛ 提交于 2021-02-11 14:22:43
问题 In a flutter app, I need to pull the users document from firestore only if the last updated field is greater then the last updated locally. Currently this is what I do: QuerySnapshot usersData = await Firestore.instance .collection("users") .where("lastUpdated", isGreaterThan: lastUpdatedLocally) .where("userId", isEqualTo: userId) .getDocuments(); Map<String, dynamic> userData = usersData.documents.isEmpty ? {} : usersData.documents.first.data; I have three questions: Is it possible to do