-
Type: Task
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
Affects Version/s: mongodb-2.6, mongodb-3.0
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