Set option bypassDocumentValidation #2386
              
                Unanswered
              
          
                  
                    
                      ruedigerm-playster
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Can anyone help me how to set the MongoDB option bypassDocumentValidation?
I wanna bypass schema validation when updating an item in MongoDB from my laravel application.
How can I pass the options array
['bypassDocumentValidation' => true]to my query?I tried
and also
Brand::find($brand->_id)->update([$data, ['bypassDocumentValidation' => true]);or
$brand->save(['bypassDocumentValidation' => true]);Every time, I still get the validation error ("Document failed validation").
Using
jenssegers/mongodb 3.9
Laravel 9.13
php 8.1
see also
https://stackoverflow.com/questions/72281028/set-option-bypassdocumentvalidation-for-laravel-mongodb-jenssegers-mongodb
Beta Was this translation helpful? Give feedback.
All reactions