I am attempting to use Geofirestore with my VueJs/Firestore application but can't seem to find the complete set of documentaton of the GeoFirestore library. I can only find the documentation listed at geofirestore.com and https://github.com/geofirestore/geofirestore-js but this is very limited. I have been able to successfully add location data to my FireStore collection and query it user the "Near" method but I need more information about the return results on the GeoQuerySnapshot. For instance, I receive a distance attribute in my return object but I don't whether that is in miles or kilometers or what? There has to be more documentation than what is listed on these two sites...no? Appreciate the help.
So pretty much the documentation is the Firestore documentation minus the fact that there is the added near
function.
So for example, the GeoQuerySnapshot
has three accessors (docs
, empty
and size
) and two methods (docChanges()
, and forEach()
), which is very similar to a Firestore QuerySnapshot.
If you do access the docs, which is an array of QueryDocumentSnapshot
which has 4 properties:
data
of the document (your data).distance
from your center (null if it's a query made without a location).exists
to let you know if the doc exists or not (this can change, but most likely will always be true).id
of the docAs I mentioned, the structure and what you get is almost identical to how Firestore works (except Firestore doesn't provide distance
).