firebase-admin-node
firebase-admin-node copied to clipboard
GeoPoint undefined in 11.0.1
var admin = require("firebase-admin");
new admin.firestore.GeoPoint(latitude, longitude); // Gives error -> TypeError: GeoPoint is not a constructor
The value of admin.firestore.GeoPoint is undefined
I've reverted back to version 10.3.0 and the code works again.
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
This seems similar to #1827 Could you try importing the class using the modular API? More examples are on: https://github.com/firebase/firebase-admin-node/issues/1827#issuecomment-1208475992
import { getFirestore, GeoPoint } from 'firebase-admin/firestore';
I am having an issue using the geopoint constructor.
const GeoPoint = admin.firestore.GeoPoint;
....
const geopoint = new GeoPoint(latitude, longitude);
// Add 'g' entry to data
data['g'] = {
geopoint: geopoint,
'geohash': computedGeohash
};