Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add bypassDocumentValidation property by using MongoTemplate? #4774

Open
juefeiyan opened this issue Aug 29, 2024 · 3 comments
Open
Assignees
Labels
status: feedback-provided Feedback has been provided status: pending-design-work Needs design work before any code can be developed status: waiting-for-triage An issue we've not yet triaged

Comments

@juefeiyan
Copy link

juefeiyan commented Aug 29, 2024

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?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 29, 2024
@mp911de
Copy link
Member

mp911de commented Aug 30, 2024

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?

@mp911de mp911de added the status: waiting-for-feedback We need additional information before we can continue label Aug 30, 2024
@juefeiyan
Copy link
Author

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

@juefeiyan
Copy link
Author

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?

And for the question, we want to activate bypass schema validation whenever working with such an entity

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 30, 2024
@mp911de mp911de added the status: pending-design-work Needs design work before any code can be developed label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided status: pending-design-work Needs design work before any code can be developed status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants