google-cloud-firestore

How to add or save from web form (Javascript) entry as GeoPoint type in Firebase Firestore

怎甘沉沦 提交于 2020-07-23 07:07:58
问题 Hi i have a web form which collect the following: -cafe name -latitude -longitude of its location. Currently, the lat and long is saved as map format instead of GeoPoint in Firestore. Hence i would like to seek your advice on how it could be saved as GeoPoint format/data type. form.addEventListener('submit',(e)=>{ e.preventDefault(); db.collection('sgcafe').add ({ name: form.name.value, category: form.category.value, coordinates: {Latitude:form.lat.value,Longtitude:form.long.value} //save as

How to add or save from web form (Javascript) entry as GeoPoint type in Firebase Firestore

好久不见. 提交于 2020-07-23 07:06:11
问题 Hi i have a web form which collect the following: -cafe name -latitude -longitude of its location. Currently, the lat and long is saved as map format instead of GeoPoint in Firestore. Hence i would like to seek your advice on how it could be saved as GeoPoint format/data type. form.addEventListener('submit',(e)=>{ e.preventDefault(); db.collection('sgcafe').add ({ name: form.name.value, category: form.category.value, coordinates: {Latitude:form.lat.value,Longtitude:form.long.value} //save as

Profile fragment code not working in kotlin

久未见 提交于 2020-07-23 06:24:23
问题 I making my profile fragment and I want to display the post and the number of post in the Profile of the app. I have searched for the code from websites and I wrote this codes but this codes are not working. Here is my code class ProfileFragment : Fragment() { var fragmentView: View? = null var firestore: FirebaseFirestore? = null var uid: String? = null var auth: FirebaseAuth? = null var currentUserUid: String? = null override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,

Profile fragment code not working in kotlin

与世无争的帅哥 提交于 2020-07-23 06:23:19
问题 I making my profile fragment and I want to display the post and the number of post in the Profile of the app. I have searched for the code from websites and I wrote this codes but this codes are not working. Here is my code class ProfileFragment : Fragment() { var fragmentView: View? = null var firestore: FirebaseFirestore? = null var uid: String? = null var auth: FirebaseAuth? = null var currentUserUid: String? = null override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,

Profile fragment code not working in kotlin

久未见 提交于 2020-07-23 06:22:34
问题 I making my profile fragment and I want to display the post and the number of post in the Profile of the app. I have searched for the code from websites and I wrote this codes but this codes are not working. Here is my code class ProfileFragment : Fragment() { var fragmentView: View? = null var firestore: FirebaseFirestore? = null var uid: String? = null var auth: FirebaseAuth? = null var currentUserUid: String? = null override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,

Get user data from Firebase

两盒软妹~` 提交于 2020-07-23 06:16:08
问题 I'm trying to get user data from their uid and use it on text widget. Should I create getCurrentUser method to get the data? I have tried using querysnapshots but it did nothing. Here is the code : Expanded( child: Container( margin: EdgeInsets.only(top: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('Name'), Text('Email@email.com'), Text('+02112345678'), ], ), ), ), Here is the update : Expanded( child: Container( margin: EdgeInsets.only(top: 10

Get user data from Firebase

安稳与你 提交于 2020-07-23 06:15:07
问题 I'm trying to get user data from their uid and use it on text widget. Should I create getCurrentUser method to get the data? I have tried using querysnapshots but it did nothing. Here is the code : Expanded( child: Container( margin: EdgeInsets.only(top: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('Name'), Text('Email@email.com'), Text('+02112345678'), ], ), ), ), Here is the update : Expanded( child: Container( margin: EdgeInsets.only(top: 10

Get user data from Firebase

自作多情 提交于 2020-07-23 06:14:11
问题 I'm trying to get user data from their uid and use it on text widget. Should I create getCurrentUser method to get the data? I have tried using querysnapshots but it did nothing. Here is the code : Expanded( child: Container( margin: EdgeInsets.only(top: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('Name'), Text('Email@email.com'), Text('+02112345678'), ], ), ), ), Here is the update : Expanded( child: Container( margin: EdgeInsets.only(top: 10

TypeError: Cannot read property 'toDate' of undefined

依然范特西╮ 提交于 2020-07-22 10:09:28
问题 I have a firebase project, I am getting the below error log when running a firebase function, below are the error log and the code. the error is Cannot read property 'toDate' of undefined , converting a admin.firestore.Timestamp to Date format. How to solve this error Error Log: Unhandled error TypeError: Cannot read property 'toDate' of undefined at new PostTable (/srv/lib/index.js:9:34) at cal.then.docCollection (/srv/lib/index.js:69:39) at <anonymous> at process._tickDomainCallback

Property 'onSnapshot' does not exist on type 'AngularFirestoreCollection<unknown>'

限于喜欢 提交于 2020-07-22 08:49:04
问题 I am trying to detach listener from cloud Firebase, but I still get this error. Property 'onSnapshot' does not exist on type 'AngularFirestoreCollection' Do you know, what sould I import? I directly copy this code from Firebase documentation. let unsub = this.firestore.collection('cities').onSnapshot(() => { }); // Stop listening for changes unsub(); This is my constructor and import: import { AngularFirestore } from "@angular/fire/firestore"; constructor(public firestore: AngularFirestore) {