In the challenge model, address/location are left as non-required fields. When creating a Challenge via Mongo Compass (inserting a document with something like {"_id":{"$oid":"60caaa7cff0df79a62f2cadb"},"location":{"type":"Point","coordinates":[{"$numberDouble":"1.234"},{"$numberDouble":"1.234"}]},"taskName":"find a bench","description":"Try looking for a bench in a park","points":{"$numberInt":"3"}}) the document seems to create fine. However, when I try creating the document via a Gin route (#26), I get this error in Postman: unknown GeoJSON type: { type: \"\", coordinates: null }}]}, {<nil>}]
If I follow the instructions from here and set Location type to "Point" but leave coordinates empty, I get: Point must be an array or object}]}, {<nil>}]
Seems like we might have an issue in keeping these fields optional because of the geolocation indexes we have setup for the challengeCollection -- may need to find a workaround?
In the challenge model, address/location are left as non-required fields. When creating a Challenge via Mongo Compass (inserting a document with something like
{"_id":{"$oid":"60caaa7cff0df79a62f2cadb"},"location":{"type":"Point","coordinates":[{"$numberDouble":"1.234"},{"$numberDouble":"1.234"}]},"taskName":"find a bench","description":"Try looking for a bench in a park","points":{"$numberInt":"3"}}
) the document seems to create fine. However, when I try creating the document via a Gin route (#26), I get this error in Postman: unknown GeoJSON type:{ type: \"\", coordinates: null }}]}, {<nil>}]
If I follow the instructions from here and set Location type to "Point" but leave coordinates empty, I get:
Point must be an array or object}]}, {<nil>}]
Seems like we might have an issue in keeping these fields optional because of the geolocation indexes we have setup for the challengeCollection -- may need to find a workaround?