How can I write array of coordinates to Cloud Firestore

前端 未结 2 690
滥情空心
滥情空心 2021-01-24 19:05

How can I write an array of coordinates to the Cloud Firestore as a GeoPoint datatype?

I do have an arraylist points with coordin

2条回答
  •  借酒劲吻你
    2021-01-24 19:21

    You can write your coordinates in cloud firestore like this

        Map map = new HashMap<>();
         map.put("coordinates", Arrays.asList(points));
    
         db.collection("REFERENCE").document("mDocumentId")
                .update(map);
    

提交回复
热议问题