Major - P3
The Index management specification does not include any prose or YAML/JSON tests. We should consider adding some.
An important part of these tests would be to check that all the options for createIndexes are accepted by the server. As of MongoDB 3.4, the server validates those options (see
SERVER-769). This was not the case when the spec was written.
Testing the options behavior is particularly important because the server's createIndexes command does not align with many of the option names in the spec. For example:
- version in driver = v on server
- defaultLanguage in driver = default_language on server
- languageOverride in driver = language_override on server
- until SPEC-1111, the spec contained an expireAfter option corresponding to expireAfterSeconds on the server (now renamed to match.)
This is an easy place for errors to be introduced in drivers like Swift that use a BSONEncoder to convert options types to documents, where keys are automatically named by the property names (see
SPEC-1111 pointed out (and fixed) that storageEngine is supposed to be a document, not a string. A spec test case including the storageEngine option would easily catch this.