You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A benefit of using Mongoose over raw Mongo is that field names are
explicitly defined and validated.
It would be nice if GeoJSON.Feature could allow defining specific
'properties' as well as continuing to provide the boilerplate schema
that it already does.
Some potential syntax options:
// Option 1:
// Allow defining just properties:
geoFeature: GeoJSON.Feature({
a: 1,
b: 2,
);
//Option 2:
// Allow defining anything or everything.
// Internally, add any missing bits from the boilerplate
geoFeature: GeoJSON.Feature({
properties: {
a: 1,
b: 2,
},
});
Option 2 is the more flexible way to go. I don't think either is
backcompat, though. You would to start doing this:
geoFeature: GeoJSON.Feature();
But, perhaps that's a good direction to go anyway, as it allows you to
add extra validation to any GeoJSON schema element:
@joshkopecek What do you think about this "wish" request? It addresses the wish to mark some GeoJSON schema elements as required, add extra validation, or fill in default values for particular fields in the Schema.
The default values for properties are another issue. The only place the GeoJSON schema provides an room for flexibility is in the properties, so I can see this being one way to do it:
A benefit of using Mongoose over raw Mongo is that field names are
explicitly defined and validated.
It would be nice if GeoJSON.Feature could allow defining specific
'properties' as well as continuing to provide the boilerplate schema
that it already does.
Some potential syntax options:
Option 2 is the more flexible way to go. I don't think either is
backcompat, though. You would to start doing this:
But, perhaps that's a good direction to go anyway, as it allows you to
add extra validation to any GeoJSON schema element:
The text was updated successfully, but these errors were encountered: