How can I write an array of coordinates to the Cloud Firestore as a GeoPoint
datatype?
I do have an arraylist
with coordin
When passing FieldValue.arrayUnion as the second argument to the update() method like in the the following line of code:
docRef.update("Test", FieldValue.arrayUnion(points));
It means that you are telling Firebase that you want to update a property within a document which is of type array
with a List
, which is actually not possible, hence this error:
Nested arrays not supported
If you have documents that contain nested arrays, please note that a regular update is currently not possible. What can you do instead is to get the entire document and call getData() on the DocumentSnapshot
object. The type of object that is returned is a Map
. Iterate through the map, update the desired value and write the document back in the database.