Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-875

Cursor.hint(<index spec>).count() raises TypeError

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.0.1
    • Affects Version/s: 3.0
    • Component/s: None
    • Labels:
      None

      Found during MongoEngine upgrading:

      import pymongo
      c = pymongo.MongoClient()
      db = c["test"]
      coll = db["test"]
      coll.find().hint([('tags', 1)]).count()
      
      TypeError: passing a dict to sort/create_index/hint is not allowed - use a list of tuples instead. did you mean [('tags', 1)]?
      

      Worked with pymongo 2.8

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            ross@mongodb.com Ross Lawley
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: