google-cloud-firestore

Update the Map field - Flutter

痞子三分冷 提交于 2021-02-10 14:16:25
问题 How to update data of isVerified (Boolean) field. Personal Info is Map contains address and then isVerified. 回答1: To update isVerified , you have to do the following: Firestore.instance.collection("collection Name").document("documentId").updateData({ "Personal Info.address.isVerified": true, }).then((_) { print("success!"); }); 回答2: Since you did not provide your collection or document name I would just form one So lets assume every time we click a button the value should be changed to true

Flutter: Cloud_firestore will break your Android build if it or its dependencies aren't compatible with AndroidX

扶醉桌前 提交于 2021-02-10 07:04:46
问题 I can not use these both flutter plugins together: cloud_firestore: ^0.9.0+2 barcode_scan: ^0.0.8 When run, error occured: D8: Program type already present: android.arch.core.util.Function ********************************************************* WARNING: This version of cloud_firestore will break your Android build if it or its dependencies aren't compatible with AndroidX. See https: //goo.gl /CP92wY for more information on the problem and how to fix it. This warning prints for all Android

Firebase Cloud Functions for Firestore are not triggering

五迷三道 提交于 2021-02-10 06:34:48
问题 Cannot get Firebase Cloud Functions for Firestore to trigger on onWrite of my collection. Trying to setup device to device push notification for chat app. Function is deployed and on Pay as you go plan, however, changes in document, updates or create in "chats" collection is not triggering. Firebase cloud messaging is supposed to send a push and write to the log. Neither is happening. Push is working with other sources. Thanks for your help, wish device to device push notifications was easier

Firebase Cloud Functions for Firestore are not triggering

一笑奈何 提交于 2021-02-10 06:34:26
问题 Cannot get Firebase Cloud Functions for Firestore to trigger on onWrite of my collection. Trying to setup device to device push notification for chat app. Function is deployed and on Pay as you go plan, however, changes in document, updates or create in "chats" collection is not triggering. Firebase cloud messaging is supposed to send a push and write to the log. Neither is happening. Push is working with other sources. Thanks for your help, wish device to device push notifications was easier

FieldValue.arrayRemove() to remove an object from array of objects based on property value

三世轮回 提交于 2021-02-10 06:14:32
问题 I have a document with the following structure: { "email" : "a@gmail.com", "value" : 100, "children" : [ { "email" : "b@gmail.com", "value" : 100 }, { "email" : "b@gmail.com", "value" : 200 } ] } I want to remove all elements with the email b@gmail.com from the children array. I am able to remove one item if I pass the whole object to be removed like this: FieldValue.arrayRemove(childObject) But I want both the objects with the email b@gmail.com to be removed. Is there anyway to achieve this

Can't setState Firestore data

放肆的年华 提交于 2021-02-10 04:58:33
问题 I'm working on a React project with Cloud Firestore. I have successfully fetched data from Firestore. But I could not set state these data to state. How can I set state these data. class App extends Component { constructor(props) { super(props); this.state = { items: [] }; } async componentDidMount() { const items = []; firebase .firestore() .collection("items") .get() .then(function(querySnapshot) { querySnapshot.forEach(function(doc) { items.push(doc.data()); }); }); this.setState({ items:

Firestore rules: How do I allow access to a subcollection depending on a field of the document that contains it?

不羁的心 提交于 2021-02-09 10:58:05
问题 I am writing a small program in react that manages a league of sorts. The problem I have is how do I allow access (read, write) to the matchdays of a league for the correct user. The matchdays are named "matchday-1", "matchday-2", and so on, and are collections of documents (the matches), and are subcollections inside the league. My firebase structure looks like this basically: leagues(collection) -> league(document) -> matchday-n(collection) -> match-m(document) where n and m are numbers.

How to write to a variable from within the Firebase getDocument function (Swift)

人走茶凉 提交于 2021-02-09 07:08:02
问题 I want to read a document, get a field from that document, and set a variable to that field's value I expected my variable declared outside the Firebase getDocument function to be written to. The actual results are that the variable is being written to within the Firebase getDocument function but outside the function it is empty. Here's what I have tried: [1]: Modifying variable within firebase function - this didn't work for me because I can't translate it well with my current Swift skills

Storing a text file in Firestore's text field removes line breaks

丶灬走出姿态 提交于 2021-02-09 07:05:36
问题 I am trying to store a CSV file in a text field inside Cloud Firestore. However Firestore is stripping out all line breaks and storing the entire CSV file as a single line. The Firestore Data Types documentation does not say anything about a restriction on the type of characters that can be stored other than they should be UTF-8: Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes of the UTF-8 representation are considered by queries. Is there a documented restriction? If

Storing a text file in Firestore's text field removes line breaks

白昼怎懂夜的黑 提交于 2021-02-09 07:03:09
问题 I am trying to store a CSV file in a text field inside Cloud Firestore. However Firestore is stripping out all line breaks and storing the entire CSV file as a single line. The Firestore Data Types documentation does not say anything about a restriction on the type of characters that can be stored other than they should be UTF-8: Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes of the UTF-8 representation are considered by queries. Is there a documented restriction? If