1

Is it possible to skip validation in mongodb using pymongo?

I want to run below query from pymongo :

db.getMongo()._skipValidation = true

Any help is highly appreciated.

Thanks, Ashwin.

1 Answer 1

4

If you have schema validation configured in MongoDB, you can nevertheless bypass validation when you insert or update documents with the bypass_document_validation option:

https://api.mongodb.com/python/current/api/pymongo/collection.html#pymongo.collection.Collection.insert_one

Sign up to request clarification or add additional context in comments.

1 Comment

I am trying to figure out when I would want bypass_document_validation=True. Is it when I want to increase performance and I am sure I will always insert a valid json document?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.