This works to search a collection based on the radius from a coordinate. The issue is I am forced to create an index for the coordinate for it to work. I want to have multiple elements at the same coordinate. Is there another option than nearSphere that works without a index for coords?
...
lat := loc.Coordinates[1]
long := loc.Coordinates[0]
scope := 321869 // 100 miles
err := c.Find(bson.M{"loc": bson.M{"$nearSphere": bson.M{"$geometry": bson.M{
"type": "Point",
"coordinates": []float64{long, lat},
},
"$maxDistance": scope,
},
}}).All(&users)
...