Create and return a Collection with a jsonSchema.
(coll, json_schema)
| 633 | |
| 634 | |
| 635 | def create_with_schema(coll, json_schema): |
| 636 | """Create and return a Collection with a jsonSchema.""" |
| 637 | coll.with_options(write_concern=WriteConcern(w="majority")).drop() |
| 638 | return coll.database.create_collection( |
| 639 | coll.name, validator={"$jsonSchema": json_schema}, codec_options=OPTS |
| 640 | ) |
| 641 | |
| 642 | |
| 643 | def create_key_vault(vault, *data_keys): |
no test coverage detected