This fixes the issue where an authorized user can execute invalid commands such as
db.coll.createIndex({a: "queryable_encrypted_range"})
, which is never valid as
queryable_encrypted_range
is a pseudo-index type, or
db.coll.createIndex({a: "2dsphere_bucket})
, which is invalid on non-timeseries collections. These situations are now checked at index validation time, prior to creation, so that they do not cause the server to crash either in attempting to create an invalid index or, in the latter case, when data is inserted, e.g.
db.coll.insert({control: {version: 2}, a: HexData(0, "00")})
.