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

Clarify that _id field is included in results if not explicitly excluded.

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None

    Description

      On http://docs.mongodb.org/manual/applications/indexes/ page,
      emphasize and clarify the last sentence:

      To ensure that a query is covered, create an index that includes all the fields listed in the query result and the query document. This means that if the index does not include the _id field, the projection document, which specifies the fields MongoDB returns, must explicitly exclude the _id field from the result set.

      Also, clarify the second example -->

      { user: 1 }

      is same as

      { user:1, _id: 1 }

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 47 weeks, 2 days ago