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

Comment on: "manual/core/index-partial.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • 0.25

    Description

      Documentation Changes

      The documentation is correct as written. However, we may want to clarify WHY the second query cannot use the index to prevent future confusion like this.

      Description

      Are these two examples out of order? I may misunderstand how the index works.

      From the page:

      For example, the following query can use the index:
      db.contacts.find( { name: "xyz", email:

      { $regex: /\.org$/ }

      } )

      However, the following query cannot use the index:
      db.contacts.find( { name: "xyz", email:

      { $exists: false }

      } )

      I would have thought this should be the order:

      For example, the following query can use the index:
      db.contacts.find( { name: "xyz", email:

      { $exists: false }

      } )

      However, the following query cannot use the index:
      db.contacts.find( { name: "xyz", email:

      { $regex: /\.org$/ }

      } )

      Attachments

        Activity

          People

            jeffrey.allen@mongodb.com Jeffrey Allen
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5 years, 50 weeks, 5 days ago