google-cloud-firestore

Value of firebase database updating to null when not not edited during update data

∥☆過路亽.° 提交于 2021-01-25 03:55:48
问题 I am having a data update screen where the user can update/edit data saved in database. I have multiple fields which the user can edit. The data is prefilled with the previous value saved in database. My edit screen is as follows @override Widget build(BuildContext context) { return Scaffold( drawer: newdrawer(), appBar: newappbar( title: 'Edit Task', ), body: SingleChildScrollView( child: ConstrainedBox( constraints: BoxConstraints(), child: Center( child: Column( // mainAxisAlignment:

.where() firestore query not working properly?

偶尔善良 提交于 2021-01-24 13:40:26
问题 In the below code, when I remove the .where() from my query the query works and I get my comments returned. However, when I use the where query to try and find a comment bound to a post (scream) id, i get a blank array. Am I using .where() incorrectly? Any help would be appreciated. exports.getScream = (req, res) => { let screamData = {}; db.doc(`/screams/${req.params.screamId}`) .get() .then((doc) => { screamData = doc.data(); screamData.screamId = doc.id; return db .collection('comments')

.where() firestore query not working properly?

人走茶凉 提交于 2021-01-24 13:39:31
问题 In the below code, when I remove the .where() from my query the query works and I get my comments returned. However, when I use the where query to try and find a comment bound to a post (scream) id, i get a blank array. Am I using .where() incorrectly? Any help would be appreciated. exports.getScream = (req, res) => { let screamData = {}; db.doc(`/screams/${req.params.screamId}`) .get() .then((doc) => { screamData = doc.data(); screamData.screamId = doc.id; return db .collection('comments')

.where() firestore query not working properly?

妖精的绣舞 提交于 2021-01-24 13:38:09
问题 In the below code, when I remove the .where() from my query the query works and I get my comments returned. However, when I use the where query to try and find a comment bound to a post (scream) id, i get a blank array. Am I using .where() incorrectly? Any help would be appreciated. exports.getScream = (req, res) => { let screamData = {}; db.doc(`/screams/${req.params.screamId}`) .get() .then((doc) => { screamData = doc.data(); screamData.screamId = doc.id; return db .collection('comments')

How to add user UID in the place of firestore document ID

隐身守侯 提交于 2021-01-24 11:42:45
问题 i'm trying to get user UID in the place of auto generated document ID in Firebase/Firestore but can't get it because of this error TypeError: firebase.auth(...).currentUser is null this is my index.js file:- // Firestore Cloud Database var db = firebase.firestore(); function reg(){ //window.alert("Working..!"); const txtname = document.getElementById('txtuname').value; const txtEmail = document.getElementById('txtemail').value; const txtPass = document.getElementById('txtpass').value; /

Firestore collection group dont working with where clauses

…衆ロ難τιáo~ 提交于 2021-01-24 08:06:22
问题 I'm using FlutterFire to develop an Android app using Firebase server-less service. But, when I try to use collection group to query some data, the query return empty result when I use where clause. In my database I have one collection called ' users ', Inside every document in ' users ' exist one subcollection called ' chats ', like that: users/{userDocument}/chats/{chat} One chat is a conversation between two users, one user has the document chat inside his own document, the other user is

Google signin - not working in production

强颜欢笑 提交于 2021-01-24 07:25:10
问题 Google sign in works when testing on the emulator and a real device, however, in production it doesn't work. I have added the SHA 1 key to my Firestore project. How would I fix this? Future<User> googleSignIn() async { try { GoogleSignInAccount googleSignInAccount = await Global.googleSignIn.signIn(); GoogleSignInAuthentication googleAuth = await googleSignInAccount.authentication; final AuthCredential credential = GoogleAuthProvider.credential( accessToken: googleAuth.accessToken, idToken:

Google signin - not working in production

╄→гoц情女王★ 提交于 2021-01-24 07:22:09
问题 Google sign in works when testing on the emulator and a real device, however, in production it doesn't work. I have added the SHA 1 key to my Firestore project. How would I fix this? Future<User> googleSignIn() async { try { GoogleSignInAccount googleSignInAccount = await Global.googleSignIn.signIn(); GoogleSignInAuthentication googleAuth = await googleSignInAccount.authentication; final AuthCredential credential = GoogleAuthProvider.credential( accessToken: googleAuth.accessToken, idToken:

Firestore: How to update specific field of document?

China☆狼群 提交于 2021-01-23 11:08:16
问题 How do I access and update a specific field in angular firestore: 回答1: Ok you have to do the following steps: First make sure that you create a query either on name or ID or even both, it need to be unique Then you subscribe to this query with snapshotChanges Next you will get the id from the queried objects After this you use this id to update the doc with the new value It would look something like this: updateDoc(_id: string, _value: string) { let doc = this.afs.collection('options', ref =>

Firestore: How to update specific field of document?

你离开我真会死。 提交于 2021-01-23 11:08:02
问题 How do I access and update a specific field in angular firestore: 回答1: Ok you have to do the following steps: First make sure that you create a query either on name or ID or even both, it need to be unique Then you subscribe to this query with snapshotChanges Next you will get the id from the queried objects After this you use this id to update the doc with the new value It would look something like this: updateDoc(_id: string, _value: string) { let doc = this.afs.collection('options', ref =>