New to loopback but having fun setting up my first node based RestAPI. I am able to create models and have the associated tables created in the datastore. My models need to have properties which are data type geojson, a string of the form:
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [125.6, 10.1] } }
Some are points. Others polylines or polygons. My question is, what is the best way to configure geojson properties in the model schema. I could just set the data type to string I guess but I am hoping there is something more elegant. Ideally I would like to setup custom validation that will check that submitted data is valid geojson. Also I need to be able to query the models by location, e.g. return data within lat/lng bounds.
I choose MYSQL as the datastore for now but only because of past experience. If another data source would be preferable I'll change.
I see Raymond answered this question on the mailing list too.
https://groups.google.com/forum/#!topic/loopbackjs/D0WCPIfHhR8