I'm using MongoDB driver and mgo-forked qmgo in Go to operate MongoDB (version 5.x).
I have some geo-spatial data to store and query, and searched some articles and someone mentioned to create custom struct GeoJSON, others said another custom struct, but it's not official way and not consistent.
Is there any proper ways to store and query such data with Go packages?
Assuming you'll want to query this data using geo qualities Mongo docs do specify this
Basically the structure you want to save should match the spatial index requirements, so it should be in this structure:
<field>: { type: <GeoJSON type> , coordinates: <coordinates> }