SERVER-45588 came out of a case where a user had persisted collection validators that were considered valid in 4.0 but not in 4.2 because some checks around RegexMatchExpressions were made tighter in 4.2. This prevented upgrade.
To avoid this kind of situation in the future, we should not enforce that collection validators which have been persisted are valid until we attempt to use them (when insertions are done). We should still enforce that validators are well formed when setting/creating them (through collMod or createCollection).
It looks like this would be relatively straightforward given the way CollectionImpl enforces that validators are well formed.
- is duplicated by
-
SERVER-45588 Use of invalid regex in schema validator can prevent upgrade
- Closed