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

Call out compound key case in sparse unique indexes

      The docs state:

      sparse and unique Properties

      An index that is both sparse and unique prevents collection from having documents with duplicate values for a field but allows multiple documents that omit the key.

      The idea of the [entire] key being absent has some nuance that is not immediately apparent; in the case of a compound key, all elements of the key must be absent in order for this to apply.

      A suggested alternative would be:

      allows multiple documents that omit all fields in the key

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            steffan.mejia@mongodb.com Steffan Mejia
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 24 weeks, 2 days ago