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

.find().sort( { $natural: 1 } ) disables index use

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

      Regarding this page:
      http://docs.mongodb.org/manual/reference/method/cursor.sort/

      This contains a neat description of the use of .sort() specifically after a .find() and has a section at the bottom covering the special $natural operator.

      The page should make it clear that the use of $natural effectively disables the use of most indexes.

      There are some cases, particularly involving _id where $natural seems to work but these cases appear to be side-effects rather than intentional design choices.

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.ryder@mongodb.com Andrew Ryder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

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