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

Queries aren't covered when using 'true' or 'false' in projection (instead of '1' or '0')

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.5
    • Component/s: Index Maintenance, Querying
    • Labels:
      None
    • Environment:
      Windows 7 x64, MongoDB 2.4.5 (standalone)
    • ALL

      Trying to execute a covered query using 'true' in the projection instead of '1' seems to make the query non-covered.

      According to explain plans, the following query is covered:
      db.coll.find({_id : "val"},{_id : 1})
      But this one isn't:
      db.coll.find({_id : "val"},{_id : true})

      Same goes for the following queries where the collection has an index on the field 'a':
      /covered/ db.coll.find(

      {a : "val"}

      ,{_id : 0, a : 1})
      /* non-covered */ db.coll.find(

      {a : "val"}

      ,{_id : 0, a : true})
      /* non-covered */ db.coll.find(

      {a : "val"}

      ,{_id : false, a : 1})
      /* non-covered */ db.coll.find(

      {a : "val"}

      ,{_id : false, a : true})

      Hinting the non-covered queries doesn't seem to help.

            Assignee:
            Unassigned Unassigned
            Reporter:
            eyal.roth@sundaysky.com Eyal Roth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: