Due to SERVER-12869, normal indexes require a FETCH for exists:false and exists:true queries.

      We have a section in our documentation on Using sparse indexes to improve exists performance

      As SERVER-12869 has been open since 2014, would it make sense to expand the discussion of indexing exists to include the implications of that ticket:

      We can safely use an index on $exists queries in the following cases:
      {a:{ $exists:true }} - normal index helps, but we must still fetch
      {a:{ $exists:true }} - sparse index is exact
      {a:{ $exists:false }} - normal index requires a fetch
      {a:{ $exists:false }} - never 

      Based on customer feedback, this was not clear from the documentation.

            Assignee:
            joseph.dougherty@mongodb.com Joseph Dougherty
            Reporter:
            ronan.merrick@mongodb.com Ronan Merrick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 51 weeks ago