In MongoDB 3.6 one can specify a json schema to validate documents in a collection, but I haven't seen anything like that in pymongo.
Asked
Active
Viewed 1,933 times
1 Answers
0
Yes you can.
For adding json schema at the time you create the collection, I haven't seen any good method to do it with pymongo.
By if you want to attach a schema to existing collections, please refer to https://stackoverflow.com/a/51520384/10189759

Luk Aron
- 1,235
- 11
- 34