MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / create_with_schema

Function create_with_schema

test/test_encryption.py:635–640  ·  view source on GitHub ↗

Create and return a Collection with a jsonSchema.

(coll, json_schema)

Source from the content-addressed store, hash-verified

633
634
635def 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
643def create_key_vault(vault, *data_keys):

Callers 2

test_auto_encryptMethod · 0.70
_test_corpusMethod · 0.70

Calls 4

WriteConcernClass · 0.90
dropMethod · 0.45
with_optionsMethod · 0.45
create_collectionMethod · 0.45

Tested by

no test coverage detected