Accessing Geopoints using Firebase Cloud Functions?

I have a collection called posts in Firestore which contains a documents with the fields content and location. Content is a string and Location is a Geopoint. When accessing the database using Firebase Cloud Functions, I am able to print out the content by adding it into an array and JSON.stringfy the whole thing as a response. However, If i try to emulate this with the geopoints, I simply get an empty response {}. How do access the Geopoint values in the Firestore using Javascript so I can perform operations on/print them? i.e. find distance between two points. Answer I

How to handle for promise inside a piped map

I am definitely sure I am confused here so please any help is appreciated. Here is my scenario: I pull from Firestore a document: return this.afs.collection(“events”).doc(eventID)….

How to delete object from array in firestore

I have a problem with deleting an Object out of an Array in firestore. I have this data in firestore: And now I would like to delete e.g the second Object out of the posts Array. Code: deletePic ()…

Add field separately to firestore document

The following code creates a firestore collection and adds data to it: function saveID(sender_psid,complete){ let data = new Object(); data.ID = sender_psid; data.TASK = complete; data….

VueJS & Firestore – Uncaught (in promise) TypeError: Cannot read property of undefined

I am creating a simple app mockup in VueJS, using Google Cloud Firestore as a backend. I have a template up and running, and have the app successfully talking to the Firestore. Below is the working …

Firebase firestore cloud functions showing Error: Invalid use of type “undefined” as a Firestore argument

I have a project to add currency details into the firestore database and my project is doing with ionic 3 Whenever I add a new document to the collection a trigger function onCreate() will execute …

Conditional where clause in firestore queries

I have fetch some data from firestore but in my query I want to add a conditional where clause. I am using async-await for api and not sure how to add a consitional where clause. Here is my function …

Firebase Cloud Firestore query not finding my document

Here’s a picture of my data: I’m trying to get that document. This works: It returns: I.e., if I know the document’s key I can get the document. This doesn’t work: It just returns No such document! What’s wrong with my query? Answer The difference in your two requests is that in the first case you are retrieving one document which gives you a DocumentSnapshot which has the exists property and the data() method. In the second case you do a query, which gives you a QuerySnapshot that has to be handled differently from a DocumentSnapshot. Instead of a single