我正在尝试使用 Python 将 GeoPoint 保存在我的 Firebase Firestore 中,但没有成功。 这给我语法错误:
location=new firebase.firestore.GeoPoint(latitude, longitude)
有什么解决办法吗?也许我缺少要导入的东西,但我找不到什么。提前致谢。
最佳答案
你可以使用
from google.cloud.firestore import GeoPoint
# Just example values so the code runs.
latitude = 0.0
longitude = 0.0
location = GeoPoint(latitude, longitude)
print(location)
new
不是 python 关键字,不需要使用。
关于python - 使用 python 的 Firestore 中的 GeoPoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52497454/