google-cloud-firestore

Firestore- Showing data in Tableview

坚强是说给别人听的谎言 提交于 2020-05-08 06:04:12
问题 I am attempting to show my Firestore data into my Tableview but I can't seem to get it to show up. protocol DocumentSerializeable { init?(dictionary:[String:Any]) } struct Sourse { var name: String var content: String var timeStamp: Date var dictionary: [String: Any] { return [ "name": name, "content": content, "timestamp": timeStamp ] } } extension Sourse : DocumentSerializeable { init?(dictionary: [String : Any]) { guard let name = dictionary["name"] as? String, let content = dictionary[

Firestore Database Rules - “Create” Rule Not Working for Cloud Functions

◇◆丶佛笑我妖孽 提交于 2020-05-07 09:24:26
问题 Database Rules for Documents Created with HTTP Cloud Function The attached image shows two things: Screenshot of Firestore database collection with one document that was created via http cloud function Screenshot of Firestore 2.0 rules. Rule The rule allow create: if request.resource.data.replyTo == "hello"; was written to prevent any document from being created unless 'replyTo' == "hello". Question Why was the document allowed to be created when 'replyTo' == 'john@smith.com' ? 回答1: Cloud

Posting to Firestore with Custom Token caused Request had invalid authentication credentials. Expected … valid authentication credential

半世苍凉 提交于 2020-05-01 09:50:25
问题 Final goal: an Angular client receives a token valid for one hour in order to query data from FireStore. Steps to produce a prove of concept and learn how to work with Custom Tokens: 1 - I created a project in Firebase using firebase tool (https://console.firebase.google.com/project/firetestjimis/overview) 2 - I added Firestore database and created a collection. I chose production instead of test because this POC is aimed for security reasons. 3 - I added manually an user in Firebase

Posting to Firestore with Custom Token caused Request had invalid authentication credentials. Expected … valid authentication credential

。_饼干妹妹 提交于 2020-05-01 09:47:53
问题 Final goal: an Angular client receives a token valid for one hour in order to query data from FireStore. Steps to produce a prove of concept and learn how to work with Custom Tokens: 1 - I created a project in Firebase using firebase tool (https://console.firebase.google.com/project/firetestjimis/overview) 2 - I added Firestore database and created a collection. I chose production instead of test because this POC is aimed for security reasons. 3 - I added manually an user in Firebase

How to limit string length in firebase

六月ゝ 毕业季﹏ 提交于 2020-04-30 16:36:54
问题 I working in a firebase database. I need to limit the length of a string field. How do I do that? The path to the field is: Col1/doc1/ / /description That is, starting with the collection col1, then into doc1, then for all collections under doc1, and all documents under that collection, the description field needs to be limited to 100 characters. Can someone please explain to me how to do this? Thanks 回答1: For Cloud Firestore you can validate that the description field is no longer than 100

How to limit string length in firebase

最后都变了- 提交于 2020-04-30 16:36:25
问题 I working in a firebase database. I need to limit the length of a string field. How do I do that? The path to the field is: Col1/doc1/ / /description That is, starting with the collection col1, then into doc1, then for all collections under doc1, and all documents under that collection, the description field needs to be limited to 100 characters. Can someone please explain to me how to do this? Thanks 回答1: For Cloud Firestore you can validate that the description field is no longer than 100

How to limit string length in firebase

ぃ、小莉子 提交于 2020-04-30 16:36:15
问题 I working in a firebase database. I need to limit the length of a string field. How do I do that? The path to the field is: Col1/doc1/ / /description That is, starting with the collection col1, then into doc1, then for all collections under doc1, and all documents under that collection, the description field needs to be limited to 100 characters. Can someone please explain to me how to do this? Thanks 回答1: For Cloud Firestore you can validate that the description field is no longer than 100

Firebase Does it cost to attach and detach SnapshotListener many times when there are no changes within 30 minutes?

自闭症网瘾萝莉.ら 提交于 2020-04-30 11:43:19
问题 I want to be able to stop snapshot listener when I don't need to listen for changes so later I can get all the updates at once. Is it possible to temporarily halt the snapshot listener? I think you have to remove it explicitly and reinitialize everything according to the doc. So I can explicitly call remove and reinitialize the snapshot listener to get changes, but is there a price penalty for doing this? I know reading cached values within 30 minutes doesn't cost anything, so does this mean

Firebase Does it cost to attach and detach SnapshotListener many times when there are no changes within 30 minutes?

爷,独闯天下 提交于 2020-04-30 11:43:12
问题 I want to be able to stop snapshot listener when I don't need to listen for changes so later I can get all the updates at once. Is it possible to temporarily halt the snapshot listener? I think you have to remove it explicitly and reinitialize everything according to the doc. So I can explicitly call remove and reinitialize the snapshot listener to get changes, but is there a price penalty for doing this? I know reading cached values within 30 minutes doesn't cost anything, so does this mean

How do I loop through a firestore document that has an array of maps?

一世执手 提交于 2020-04-30 11:12:31
问题 I mostly work with dictionaries since I am fairly new but here we have an embedded struct that I need to loop through. With this, I need to be able to populate expanding cells in UITableView. My struct looks like this: struct Complain: Codable { let eMail, message, timeStamp, userEmail: String let status: Bool let planDetails: PlanDetails enum CodingKeys: String, CodingKey { case eMail = "E-mail" case message = "Message" case timeStamp = "Time_Stamp" case userEmail = "User_Email" case status,