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

embedded doc matches could use dotted field indexes

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.1.1
    • Component/s: Querying
    • Labels:
      None
    • Query
    • Fully Compatible

      Ex:

      db.user.ensureIndex({ "a.x": 1 })
      db.user.insert({ a: { x: 1, y: 2 }});
      db.user.find({ "a.x": 1 }).explain(); // uses index
      db.user.find({ a: { x: 1 }}).explain(); // doesn't use index
      

      Both queries gives you the expected result but the latter doesn't use an index.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: