Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-10340

Do not require hint() with the full index spec

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      right now you have to specify the exact name of the index for the hint to work. I'm finding a lot of cases where Mongo does not pick the right index when a sort is used. Using hint I need to specify the exact compound index and it make the code brittle because if the index is not there as-is then those queries will just fail. Hinting would be much more usable if it allows to match a prefix.
      For example:

      • index { tenantId, userId, time, coveredField }
      • hint on { tenantId, userId }

        should just match that index

            Assignee:
            Unassigned Unassigned
            Reporter:
            antoine Antoine Girbal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: