Greetings,
I’m using Go with the official MongoDB driver to run an aggregation query with three stages (match, addFields, project), but I’m getting the following error:
(AtlasError) coordinates.coordinates is not allowed in this atlas tier
The exact same query works fine in MongoDB Compass and the same query without the match stage works in Go, so the issue appears to be with the match stage:
matchStage := bson.M{
"coordinates.coordinates": bson.M{
"$geoWithin": bson.M{
"$geometry": bson.M{
"type": "Polygon",
"coordinates": coordinates,
},
},
},
}
The same query works in Go as a find query, so I’m guessing that the free tier M0 that I’m currently using limits geospatial matching in aggregation, but I’m not quite sure since this limitation is not listed among the known limitations.
The size of the whole collection is only 4 MB and I’m using the latest version of the driver as well as Go.
Could you please advise on:
- What is the precise issue?
- Is there a way to correct or circumvent it?
- If this is a deliberate limitation, which is the cheapest tier one needs to run this query?
Thank you!