spring-data-mongodb
spring-data-mongodb copied to clipboard
How to add bypassDocumentValidation property by using MongoTemplate?
Hi there, we have an application that uses MongoTemplate.findAndModify the method to update MongoDB, and I want to add bypassDocumentValidation to the query.
However, I noticed that the FindAndModifyCallback doesn't pass bypassDocumentValidation from the FindAndModifyOptions to the FindOneAndUpdateOptions . I'm wondering if there's any way to bypass document validation using MongoTemplate?
We generally do not support bypassDocumentValidation because none of our interfaces accepts such a flag (for insert, update, replace, bulk). There's no way to access Mongo's …Options models from outside.
Generally speaking, we derive a lot of these options from our domain models. How are you using bypassDocumentValidation? Is that a one-time thing or something you would want to activate whenever working with such an entity?
We want to add schema validation but don't want to impact our customers. The idea is that we set bypassschenavalidation to true, then remove it if we confirmed everything is ok. Is it possible to add bypassschenavalidation to the FindAndModifiedOption and pass it to the FindAndUpateOption? I can draft the PR if it is possible
We generally do not support
bypassDocumentValidationbecause none of our interfaces accepts such a flag (for insert, update, replace, bulk). There's no way to access Mongo's…Optionsmodels from outside.Generally speaking, we derive a lot of these options from our domain models. How are you using
bypassDocumentValidation? Is that a one-time thing or something you would want to activate whenever working with such an entity?
And for the question, we want to activate bypass schema validation whenever working with such an entity