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

Query for NULL values on sparse indexes

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • v1.3.11
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      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.

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

              Created:
              Updated:
              Resolved:
              9 years, 32 weeks, 3 days ago