Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-3995

Query for NULL values on sparse indexes

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • v1.3.11
    • None
    • manual
    • None

    Description

      The following pages discuss mongod behavior when searching on null values and sparse index behavior. We are missing the cross over between the two.

      The "How do I query for fields that have null values? FAQ" should mention behavior when a sparse index is involved as it is an exception to what we have written. When searching for a null value on sparse index you will not get back documents that are missing that field completely.

      The sparse index page mentions that it only includes documents where the given field exists. It may be worth mentioning as well that a find() on a null value against a sparse index will not return documents where the field does not exist - contrary to the behavior when a non-sparse index is used.

      Attachments

        Activity

          People

            andrew.aldridge@mongodb.com Andrew Aldridge
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 21 weeks, 2 days ago