Daggron
Daggron

Reputation: 1

How do I get a reference to a Geopoint field in a FireStore document?

I'm still new in programming, but I have a background in Java, I'm making a small android project to mimic Uber, I'm following tutorials mostly and trying to figure things out, now I'm stuck with a Geopoint field in a document that I can't reach, any help would be appreciated, thanks in advance.This is the database I'm working on, I'm trying to reach the field with the line underneath

Upvotes: 0

Views: 42

Answers (1)

Abdur Rahman
Abdur Rahman

Reputation: 1001

FirebaseFirestore.getInstance()
    .collection("driversAvailable").document("6p......ZK5")
    .get().addOnSuccess{ snapshot -> 
               val l = snapshot.get("l")
           }

This is just a sample how to get Geo Point which is l in this case. But its not good approach to hard code the ID of driver.

Upvotes: 0

Related Questions