• Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.7.2
    • Component/s: Query Operations
    • None
    • Environment:
      Windows 10; 64-bit
    • Minor Change

      This all happens within pymongo. I have created a cursor from a collection using a find on the collection. When I do a "cursor.count()", I receive the deprecation warning -
      -----------------
      D:/MyDocuments/SoftwareStuff/Python/Mongo/mongoPeople/devPeople/PeopleShell.pyw:1: DeprecationWarning: count is deprecated. Use Collection.count_documents instead.
      #!/usr/bin/env python
      111
      -----------------
      The count matches the count I get when perform the find using Compass.

      However, if I try to execute the "cursor.count_documents" (and its variations), I receive an error that the function does not exist. -
      -----------------
      the_cllctn.count_documents()
      Traceback (most recent call last):
      File "<input>", line 1, in <module>
      AttributeError: 'Cursor' object has no attribute 'count_documents'
      the_cllctn.count_documents
      Traceback (most recent call last):
      File "<input>", line 1, in <module>
      AttributeError: 'Cursor' object has no attribute 'count_documents'
      -------------------

      I am just bringing this to your attention.
      Randy Raymond

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            RandyERaymond Randy Raymond [X]
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: