Google Cloud Firestore 運算子

Cloud Firestore 是一個彈性、可擴展的資料庫,適用於 Firebase 和 Google Cloud 的行動、網站和伺服器開發。如同 Firebase Realtime Database,它透過即時監聽器讓您的資料在用戶端應用程式之間保持同步,並為行動和網站提供離線支援,讓您可以建置反應靈敏的應用程式,無論網路延遲或網際網路連線狀況如何都能正常運作。Cloud Firestore 也提供與其他 Firebase 和 Google Cloud 產品(包括 Cloud Functions)的無縫整合。

先決條件任務

若要使用這些運算子,您必須執行幾項操作

匯出資料庫

將 Google Cloud Firestore 中所有或部分文件副本匯出到 Google Cloud Storage,是透過 CloudFirestoreExportDatabaseOperator 運算子執行。

tests/system/google/cloud/gcs/example_firestore.py[原始碼]

export_database_to_gcs = CloudFirestoreExportDatabaseOperator(
    task_id="export_database_to_gcs",
    project_id=PROJECT_ID,
    body={"outputUriPrefix": EXPORT_DESTINATION_URL, "collectionIds": [EXPORT_COLLECTION_ID]},
)

您可以搭配 bodygcp_conn_idapi_versionimpersonation_chain 參數使用 Jinja 模板,讓您動態決定值。

參考資料

如需更多資訊,請參閱

這篇文章對您有幫助嗎?