Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

firebase - Nested arrays are not supported

The new Firebase database Firestore says

Function DocumentReference.set() called with invalid data. Nested arrays are not supported.

When trying to save the following object:

{
  "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" ]
  }
}

what exactly is the nested array that firestore is complaining about? I can't find it in the documentation.

If it's the GeoJSON object - how would I save it instead?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...