Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2011

Erroneous $nearSphere error

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.7
    • Component/s: None
    • Labels:

      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.

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            owenallenaz Owen Allen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: