Hi people!
I'm having problems executing queries in MongoDB inside Metabase with geospatial query operator. Could you help me?
[$match: {
location: {
$near: {
$geometry: { type: "Point", coordinates: [ -40.28, -20.312 ] },
$minDistance: 1000,
$maxDistance: 5000
}
}
}
]
The error:
Command failed with error 2 (BadValue): '$geoNear, $near, and $nearSphere are not allowed in this context' on server mongo-qa-common-shard-00-02.lfnyi.mongodb.net:27017. The full response is { "operationTime" : { "$timestamp" : { "t" : 1633122473, "i" : 1 } }, "ok" : 0.0, "errmsg" : "$geoNear, $near, and $nearSphere are not allowed in this context", "code" : 2, "codeName" : "BadValue", "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1633122473, "i" : 1 } }, "signature" : { "hash" : { "$binary" : "ngMRSKK2AoMILyT9B4eQuMPyKz8=", "$type" : "00" }, "keyId" : { "$numberLong" : "6984105916991799297" } } } }