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
If I want to disable validation on UpdateOperators.set(), there is no way to do so. The Query object holds enableValidation() and disableValidation() methods, but they have no effect on the validation of paths in update operators, and there is no longer any method which would have the desired effect, and therefore any object for which there is a custom codec is very unlikely to pass validation and can no longer be updated.
The text was updated successfully, but these errors were encountered:
This error resolved. I think it may still be a bug, and I would be tempted to change UpdateBase line 76 to read something like...
PathTarget pathTarget = new PathTarget(mapper, mapper.getEntityModel(type), update.field(), <query.isValidating() although query does not expose that curently, but maybe should>);
However, in the midst of trying that I found that JSON.parse() is deprecated, and BasicDBObject.parse() which is the recommended replacement throws an error if the value being parsed is not a document, which makes it useless. So I wrote my own converter from jackson's JsonNode directly to BsonValue, and when I UpdateOperators.set() with a BsonValue, I no longer get a validation error on the path. So my problem resolved and I'll close this issue, but... maybe UpdateBase should respect query.disableValidation()?
If I want to disable validation on UpdateOperators.set(), there is no way to do so. The Query object holds enableValidation() and disableValidation() methods, but they have no effect on the validation of paths in update operators, and there is no longer any method which would have the desired effect, and therefore any object for which there is a custom codec is very unlikely to pass validation and can no longer be updated.
The text was updated successfully, but these errors were encountered: