google-cloud-firestore

Problem with Firestore database and storage

◇◆丶佛笑我妖孽 提交于 2021-01-29 15:54:56
问题 I am trying to save an image in storage, get the URL for that image and then stop the URL in a field in the database. The problem is that the image gets saved, but not the information for the document in the database, I have tried delaying the storage part but nothing works. I am not sure if the url is the issue or not, it seems if the image is already stored, then a re save of the document works. Here is my function: any help or guidance would be appreciated (I am a new to coding) @IBAction

How to append data when fetching a second time

只谈情不闲聊 提交于 2021-01-29 15:38:02
问题 I am having trouble with appending my data when I call my fetch method a second time. On the initial render, my component fetches data from my database and stores it in my followingData state. Then, when I scroll to the bottom, I call my fetchData function again, but instead of my new data being appended in to the followingData state, it replaces it, and now only the new data is displayed on the my screen. Here is the code: function Following({route, navigation}) { const [followingData,

How to integrate security rules into Firestore client from Python's server client library?

孤者浪人 提交于 2021-01-29 15:30:44
问题 I am trying to test my security rules using the Firestore emulator. I made a firestore.rules security rule that disallows all reads and writes: service cloud.firestore { match /databases/{database}/documents { allow read, write: if false; } } I started the Firestore emulator from the terminal: firebase emulators:start --only firestore I then initialized my Firestore client: import firebase_admin from firebase_admin import firestore firebase_app = firebase_admin.initialize_app() self.client =

How to return failed task result in continuation task [duplicate]

霸气de小男生 提交于 2021-01-29 15:06:27
问题 This question already has an answer here : How to return failed task result in continuation task? (1 answer) Closed 9 days ago . I'm writing my first app in Kotlin and am using Firestore & Firebase Storage. In the process of deleting a document, I want to delete all files in Storage that the document references (as it is the only reference to them in my case). If the Storage delete fails, I want to abort the document delete, in order to avoid orphan files in my Storage. I also want to do

Showing Recent Issues clang: error: linker command failed with exit code 1 (use -v to see invocation)?

南笙酒味 提交于 2021-01-29 14:40:11
问题 I am new to IOS app development..I trying to integrate firebase firestore..After doing all add commands..I build using command+B then I am getting below errors...how to solve Below is my error Below is my project structure 回答1: Try to open project.xcworkspace instead of project.xcodeproj . Note: Press Command + Q to exit xcode. And open yourfile.xcworkspace . 回答2: Clean your project and build again solve your problem. Product - Clean Then also, if error is still there delete you derived data.

using same value for radioButton when posting to firestore

雨燕双飞 提交于 2021-01-29 14:39:10
问题 I have a 2 radioButtons in my layout . One is for yes and the other is for no when asked if insured or not. When I click my save button and the data posts to firestore , it shows both NO INSURED and YES INSURED . The way I have my code set up is why it's that way but what I want to do is have one source where if the person clicks yes or no then in firestore I will have Insured : Yes or Insured : No . I will post my code down below import android.content.Intent; import android.os.Bundle;

How to generate and guarantee unique values in firestore collection?

 ̄綄美尐妖づ 提交于 2021-01-29 14:28:51
问题 Lets say we have a order collection in firestore where each order needs to have a unique readable random order number with lets say 8 digits: { orderNumber: '19456734' } So for every incoming order we want to generate this unique number. What is the recommended approach in firestore to make sure no other document is using it? Note : One solution would be querying existing docs before saving, but this is not working in a concurrent scenario where multiple orders arrive at the same time (?).

fireStore type does not match [String:any]

狂风中的少年 提交于 2021-01-29 14:10:49
问题 jumping into FireStore following the official documentation, trying to connect a Struct to Firestore/setdata functions, according to the documentation, Cloud Firestore converts the objects to supported data types and can handle custom classes so the struct goes as follow : public struct City: Codable { let name: String let state: String? let country: String? let isCapital: Bool? let population: Int64? enum CodingKeys: String, CodingKey { case name case state case country case isCapital =

Get list of documents inside different collections with Firestore in Flutter

烈酒焚心 提交于 2021-01-29 14:01:10
问题 I have a list of users with different portfolios. Each portfolio has the same properties but also a collection of investments. It'd be something like this: Map user = { "name": "John", "portfolios": [ // collection { "title": "My portfolio 1", "investments": [ // collection {"title": "My investment 1.2"}, {"title": "My investment 1.2"} ] }, { "title": "My portfolio 2", "investments": [ // collection {"title": "My investment 2.1"}, {"title": "My investment 2.2"}, {"title": "My investment 2.3"}

How can I put retrieved data from firebase to a widget in Flutter?

旧街凉风 提交于 2021-01-29 13:56:12
问题 final String uid; final firestoreInstance = Firestore.instance; void printData() async{ var firebaseUser = await FirebaseAuth.instance.currentUser(); firestoreInstance.collection("users").document(firebaseUser.uid).get().then((value){ print(value.data); }); } So this function prints to console the retrieved data from firebase firestore when I press the button. But I want to put them into a widget and display them in my app. For ex: Text(printData()) - but it's not allowed. How can I do that?