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

How could I use covered query with null value ?

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • Labels:
      None

      I have a collection with 2 documents such as:

      • {_id: 1, test: 1}
      • {_id: 2, test: null}

      On this collection, I have 1 index such as:

      • {test: 1}

      Explain a query tell me that :

      • query on {test: 1}

        is a covered query.

      • query on {test: null}

        is not.

      How could I use a covered query in this specific case to use my index without needing to scan the collection ?

      Thanks.

            Assignee:
            Unassigned Unassigned
            Reporter:
            bappr Benjamin Appréderisse
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: