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

embedded doc matches could use dotted field indexes

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.1.1
    • Querying
    • None
    • Query
    • Fully Compatible

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: