【发布时间】:2017-10-05 20:07:14
【问题描述】:
新的 Firebase 数据库 Firestore 说
使用无效数据调用函数 DocumentReference.set()。不支持嵌套数组。
尝试保存以下对象时:
{
"desc" : "Blala",
"geojson" : {
"features" : [ {
"geometry" : {
"coordinates" : [ 8.177433013916017, 48.27753810094064 ],
"type" : "Point"
},
"type" : "Feature"
} ],
"type" : "FeatureCollection"
},
"location" : {
"lat" : 48.27753810094064,
"lng" : 8.177433013916017
},
"name" : "Wald und Wiesen",
"owner" : "8a2QQeTG2zRawZJA3tr1oyOAOSF3",
"prices" : {
"game" : {
"Damwild" : 10,
"Raubwild" : 300,
"Rehwild" : 250,
"Schwarzwild" : 40
},
"perDay" : 35
},
"rules" : "Keine Regeln!",
"wild" : {
"desc" : "kein Wild",
"tags" : [ "Damwild", "Rehwild", "Schwarzwild", "Raubwild" ]
}
}
firestore 抱怨的嵌套数组到底是什么?我在文档中找不到它。
如果是 GeoJSON 对象 - 我将如何保存它?
【问题讨论】:
-
有趣的是,这个文档建议支持嵌套数组。也许这是代码或文档中的错误? cloud.google.com/firestore/docs/manage-data/add-data#data_types
-
你解决过这个问题吗?我遇到了同样的错误,使用 CodableFirebase。
-
@ProblemsOfSumit,您能否确认您是否能够保存 geoJSON。我仍然收到“FIRInvalidArgumentException”,原因:“不支持嵌套数组”
标签: firebase google-cloud-firestore