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

Clarify number of index entries per array

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual
    • Labels:
      None

      Description

      From the docs it wasn't clear to me that the number of index entries for an array field is based on the number of distinct values in the array.

      I read the docs below to imply that the number of entries is based on the number of values in the array.

      For example, this array [1,1,2] will generate 2 index entries, not 3. This was highlighted in NHTT training and I think the docs should explain it.

      https://docs.mongodb.com/manual/core/index-multikey/
      "To index a field that holds an array value, MongoDB creates an index key for each element in the array. "

      https://docs.mongodb.com/manual/indexes/
      "MongoDB creates separate index entries for every element of the array"

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mark.callaghan Mark Callaghan (Inactive)
            Participants:
            Last commenter:
            Ravind Kumar Ravind Kumar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Dates

              Created:
              Updated:
              Days since reply:
              1 year, 35 weeks, 5 days ago
              Date of 1st Reply: