You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Occasionally, when updating document definitions, it is necessary to introduce a breaking change to the schema. However, if there are already documents in the database that conform to the old schema but not the new schema (e.g. a string's regexPattern or an integer's minimumValue have changed), this can require a full, complicated data migration to the new format that may result in revision conflicts if any of the documents in question also happen to have been modified by an offline client. Sometimes this is unavoidable, but in other cases it is acceptable to "grandfather" the old value in for existing documents (e.g. a product ID format that is no longer used for new products, but is still valid for old, obsolete products).
This feature would introduce a new universal item validation constraint (e.g. skipValidationWhenValueUnchanged) that suppresses validation errors for that property/element when replacing a document revision where the corresponding property/element has the same semantic value. Also introduce a constraint that requires strict equality (e.g. skipValidationWhenValueUnchangedStrict).
The code property must be four lowercase letters, followed by a dash and three digits. However, if the previous version of the code property's regexPattern expected only two digits at the end, then values from existing documents that match that regular expression would be invalid if not for the skipValidationWhenValueUnchanged option.
Therefore with a previous document body of { "code": "abcd-12", "quantity": 5 }, the following new document revision would be considered valid even though it validates the updated regexPattern for code: { "code": "abcd-12", "quantity": 4 }
The text was updated successfully, but these errors were encountered:
…ally equal value
Introduces the `skipValidationWhenValueUnchanged` constraint for all validation types. When enabled, validation is not performed on the property or element when it semantically equals the value from the previous revision (e.g. a `datetime` of "2018-06-13T18:01-07:00" is semantically equal to "2018-06-13T21:01-04:00"). The result is that, even if the property or element no longer satisfies the item constraint(s), its value will be allowed if it has not changed.
… equal value
Introduces the `skipValidationWhenValueUnchangedStrict` constraint for all validation types. When enabled, validation is not performed on a property or element when it _strictly_ equals the value from the previous revision (e.g. a `datetime` of "2018-06-13T18:01-07:00" is not strictly equal to "2018-06-13T21:01-04:00" even though they refer to the same point in time). The result is that, even if the property or element no longer satisfies the item constraint(s), its value will be allowed if it has not changed at all.
Feature Request
Description
Occasionally, when updating document definitions, it is necessary to introduce a breaking change to the schema. However, if there are already documents in the database that conform to the old schema but not the new schema (e.g. a
string
'sregexPattern
or aninteger
'sminimumValue
have changed), this can require a full, complicated data migration to the new format that may result in revision conflicts if any of the documents in question also happen to have been modified by an offline client. Sometimes this is unavoidable, but in other cases it is acceptable to "grandfather" the old value in for existing documents (e.g. a product ID format that is no longer used for new products, but is still valid for old, obsolete products).This feature would introduce a new universal item validation constraint (e.g.
skipValidationWhenValueUnchanged
) that suppresses validation errors for that property/element when replacing a document revision where the corresponding property/element has the same semantic value. Also introduce a constraint that requires strict equality (e.g.skipValidationWhenValueUnchangedStrict
).Examples
Consider the following document definition:
The
code
property must be four lowercase letters, followed by a dash and three digits. However, if the previous version of thecode
property'sregexPattern
expected only two digits at the end, then values from existing documents that match that regular expression would be invalid if not for theskipValidationWhenValueUnchanged
option.Therefore with a previous document body of
{ "code": "abcd-12", "quantity": 5 }
, the following new document revision would be considered valid even though it validates the updatedregexPattern
forcode
:{ "code": "abcd-12", "quantity": 4 }
The text was updated successfully, but these errors were encountered: