我正在尝试使用 Python 在我的 Firebase Firestore 中保存 GeoPoint,但我没有成功。这给了我语法错误:
location=new firebase.firestore.GeoPoint(latitude, longitude)
Run Code Online (Sandbox Code Playgroud)
有什么解决办法吗?也许我缺少要导入的东西,但我找不到什么。提前致谢。
我想知道如何从上传到Firebase存储的文件中获取url?这是我的代码:
import firebase_admin
from firebase_admin import credentials, firestore, storage
cred=credentials.Certificate('/serviceAccountKey.json')
firebase_admin.initialize_app(cred, {
'storageBucket': <my_bucket_name>
})
db = firestore.client()
bucket = storage.bucket()
blob = bucket.blob('image.jpg')
blob.upload_from_filename('/image.jpg')
#here I'd like to have url of file I uploaded
print(blob.<url>)
Run Code Online (Sandbox Code Playgroud)
提前致谢。