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

countDocuments: $geoNear, $near, and $nearSphere are not allowed in this context

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      Using the query in countDocuments() in the code below causes this error: "
      MongoError: $geoNear, $near, and $nearSphere are not allowed in this context".
      It doesn't happen when using the same query in count(). Since countDocuments() deprecates count() I thought this might be a bug.
       
      Full repro: https://pastebin.com/WSEgM7X1
       
      Using node 8.15.0, mongodb package 3.1.12 and mongodb server 4.0.3 locally as replicaset.
       
       

            Assignee:
            Unassigned Unassigned
            Reporter:
            christilut@gmail.com Christiaan Maks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: