|
A prefix of a non-positional indexed field will now be said to cause the index to be multikey as a result of inserting the generated keys only if the arrElt array value contained multiple elements. This change in the definition of multikey is aligned with SERVER-5580 and will only become user-facing after the changes from SERVER-22726. SERVER-22726 will cause a regular ascending/descending index to be set as multikey (in IndexAccessMethod) based on whether any set in the returned MultikeyPaths is nonempty.
Index: {a: 1}
|
Document: {a: [1]}
|
⇒ Multikey paths: []
|
|
Index: {a: 1}
|
Document: {a: [1, 1]}
|
⇒ Multikey paths: ["a"]
|
|
Index: {a: 1}
|
Document: {a: [1, 2]}
|
⇒ Multikey paths: ["a"]
|
Note: the creation of v0 indexes has been disallowed since 3.1.9 (see SERVER-17425), so only BtreeKeyGeneratorV1::getKeysImpl() needs to be updated to return the prefixes of the indexed fields that cause the index to be multikey as a result of inserting the generated keys.
|