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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 3.0
    • 3.0.1
    • None
    • None

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: