Pymongo schema support

according to documentation,
schema could be added when using mongo shell to add a collection
However does pymongo suppose this ?

1 Like

I use python with MongoDB but I always do schema in Node.js

Welcome to the community!

Can you provide more information on the documentation reference you are referring?

MongoDB has flexible schema, so unlike tabular databases there is no central catalog or required schema for a collection. You can define Schema Validation rules for inserts and updates if more rigor is required.

Pymongo (and other MongoDB drivers) support the same functionality available via the mongo shell, so if you can provide some details on the documentation you are reviewing we may have more specific suggestions.


You might find your answer here: Defining data schema using pymongo