-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.2.7
-
Component/s: None
-
Labels:
-
Empty show more show less
If you attempt a count() when your filter contains a $nearSphere you receive the following error:
MongoError: $nearSphere is not allowed inside of a $match aggregation expression
Now in the driver docs this is called out http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments . But my question is why? If I shell into mongodb I can execute the same exact query with count() and a $nearSphere there is no error, so the mongo DB server supports the syntax, why is that the syntax is rejected when using the Node driver. We discovered this issue on a Mongo Server 3.4, but I've verified this on both Mongo Server 4.0, so it doesn't appear to be a deprecation thing.