7
在數據庫UI中,我可以創建類型爲geopoint
的字段。提供值後,它看起來像這樣:如何在Firebase Cloud Firestore中保存GeoPoint?
location: [1° N, 1° E]
我想通過客戶端SDK(網絡)保存到數據庫。 基於微博反饋我試圖以GeoJSON,COORDS陣列和COORDS對象:
location: [1, 2];
location: {
latitude: 1,
longitude: 2,
};
location: {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
}
}
其中沒有導致在數據庫中的GeoPoint類型。它們只保存爲對象/數組。
如何通過Web SDK將GeoPoint保存在Firebase Cloud Firestore中?
的作品就像一個魅力! – ProblemsOfSumit
你導入了什麼來獲得GeoPoint類?我試過firebase和firebase /應用程序,但沒有去。我在一個firebase-admin應用程序。 – neonguru
@neonguru - 你有沒有更新到最新的管理員SDK?它應該在那裏https://firebase.google.com/docs/reference/admin/node/admin.firestore.GeoPoint – Scarygami