1. What happens if a field has 2 indexes, a hashed one and the default b-tree one?
  2. Specifically, what happens if I create an additional hashed index on the _id field, which by default is indexed?
  3. When I query to find a document with a specific _id, which index will mongo use?
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Jan 27 at 21:19
  • What is your motivation in creating the second index? Feb 26 at 4:15
  • Hashed index has O(n) of 1 Feb 26 at 4:27


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.