Search code examples
mongodbpymongomongodb-indexes

Pymongo collection.find_and_modify, specifying index to use? $hint?


My find_and_modify query is using the wrong index.

Is there a way, using PyMongo, to hint the correct index (by name or otherwise)?

Nothing seems to mention this at all in any docs...


Solution

  • According to SERVER-7105, using $hint with FindAnyModify isn't supported.

    Posted originally by JohnnyHK