mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Style json keys should not contain dots (.) or start with a dollar sign ($) #446

Closed jingsam closed 8 years ago

jingsam commented 8 years ago

I am trying to store style json in mongodb. Mongodb complains that keys must not contain '.' or start with a dollar sign ($). I found that metadata keys contain dot sign. Also, paint property can have dot sign to specify class-specific paint properties. I think can be use nested keys instead, such as:

paint.light : {
}

paint: {
  light: {
  }
}
jfirebaugh commented 8 years ago

I don't think it makes sense to limit the style specification to a subset of JSON just to support the limitations of some particular third-party database implementation. If mongodb doesn't support JSON, you'll need to stringify before storage.