5

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.

Eduardo
  • 1,235
  • 16
  • 27

1 Answers1

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