google-cloud-firestore

How to delete a field in Firestore document with flutter

余生长醉 提交于 2020-04-10 09:29:50
问题 I'm making a Flutter application. But, I cannot delete a field in the Firestore document. In another language I know to use FieldValue.delete() to delete a file in Firestorm document. In Dart, How do I delete? 回答1: Update Oct,2018: This is Now Possible: In Order to delete a particular field from a cloud firestore document - make sure you are using Plugin version 0.8.0 or Above. Now a E.g If you have an Document having Field 'Desc' with contain some Text. In Order to Delete it. Firestore

How to delete a field in Firestore document with flutter

末鹿安然 提交于 2020-04-10 09:28:25
问题 I'm making a Flutter application. But, I cannot delete a field in the Firestore document. In another language I know to use FieldValue.delete() to delete a file in Firestorm document. In Dart, How do I delete? 回答1: Update Oct,2018: This is Now Possible: In Order to delete a particular field from a cloud firestore document - make sure you are using Plugin version 0.8.0 or Above. Now a E.g If you have an Document having Field 'Desc' with contain some Text. In Order to Delete it. Firestore

Firestore Update a document field Using Rest API

有些话、适合烂在心里 提交于 2020-04-10 08:59:49
问题 Im trying to perform PATCH Opeartion in cloud firestore using REST API. This is my Request body `{ "fields": { "name": { "stringValue":"Dinesh" } } }` When i fire the request , All the existing fields inside the document are getting deleted and only the name field is getting updated. In the Documentation they have given the Document Mask Document Mask. but i dont understand how it works , neither im able to find any samples for that. Somebody know how to update only one field inside the

In firebase login getting error “An account already exists with the same email address but different sign-in credentials” in android

感情迁移 提交于 2020-04-10 04:04:21
问题 Here am trying to implement Google, Facebook and Twitter login using firebase. I have faced many scenario which was not clear for me. Each individual login is working correctly, I didn`t found any problem here. My requirement is when the user log-in with xxxxx@gmail.com for the first time with some provider(Google,Facebook,twitter) and after success, user logged out. On second log-in the user use same id xxxxx@gmail.com with some other provide rather than one used before,that time We should

Flutter - firebase_auth updateProfile method is not working

廉价感情. 提交于 2020-04-10 02:54:56
问题 I'm creating app using Flutter with Firebase. I have some weird issues. I'm creating authentication and it is working fine but when i try to add some collections to my Firestore Database, the record of displayName is set to null. Future<FirebaseUser> createUser(email, password, displayName) async { final FirebaseUser user = await _auth.createUserWithEmailAndPassword( email: email, password: password); UserUpdateInfo info = new UserUpdateInfo(); info.displayName = displayName; _auth

Flutter - firebase_auth updateProfile method is not working

倾然丶 夕夏残阳落幕 提交于 2020-04-10 02:54:30
问题 I'm creating app using Flutter with Firebase. I have some weird issues. I'm creating authentication and it is working fine but when i try to add some collections to my Firestore Database, the record of displayName is set to null. Future<FirebaseUser> createUser(email, password, displayName) async { final FirebaseUser user = await _auth.createUserWithEmailAndPassword( email: email, password: password); UserUpdateInfo info = new UserUpdateInfo(); info.displayName = displayName; _auth

Difference between get() and snapshot() in Cloud Firestore

﹥>﹥吖頭↗ 提交于 2020-04-09 17:52:33
问题 I am reading some data from Firebase's Cloud Firestore but I've seen several ways to do it. The example I saw used the get and onSnapshot function like this: db.collection("cities").doc("SF") .onSnapshot(doc => { console.log(doc.data()); }); or this var docRef = db.collection("cities").doc("SF"); docRef.get().then(doc => { if (doc.exists) { console.log("Document data:", doc.data()); } else { console.log("No such document!"); } }).catch(function(error) { console.log("Error getting document:",

Difference between get() and snapshot() in Cloud Firestore

∥☆過路亽.° 提交于 2020-04-09 17:50:09
问题 I am reading some data from Firebase's Cloud Firestore but I've seen several ways to do it. The example I saw used the get and onSnapshot function like this: db.collection("cities").doc("SF") .onSnapshot(doc => { console.log(doc.data()); }); or this var docRef = db.collection("cities").doc("SF"); docRef.get().then(doc => { if (doc.exists) { console.log("Document data:", doc.data()); } else { console.log("No such document!"); } }).catch(function(error) { console.log("Error getting document:",

Enable Cors in Firebase Cloud Function

风流意气都作罢 提交于 2020-04-08 18:15:13
问题 I have written some cloud functions and deployed them now i am trying to hit those APIs using my Angular application but i am getting this error Access to XMLHttpRequest at 'xxxxxxxxxxxxxxxxxxxxxxxx' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. I know i have to enable cors in my cloud function but i have never done that before

What is snapshotchanges in firestore

妖精的绣舞 提交于 2020-04-08 04:40:06
问题 this function is called by the constructor. can someone explain in depth to me what it does? initializeItems(){ this.travelList$ = this.plsdala.getTravelList() .snapshotChanges() .map( changes => { return changes.map(c=>({ key: c.payload.key, ...c.payload.val() })).slice().reverse(); //to reverse order }); } 回答1: It is current state of firestore collection. It returns an Observable of data. You would use it whenever you want to be able to get also your metadata as documentID as opposed to