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

Function _parse_canonical_minkey

bson/json_util.py:775–781  ·  view source on GitHub ↗

Decode a JSON MinKey to bson.min_key.MinKey.

(doc: Any, dummy0: Any)

Source from the content-addressed store, hash-verified

773
774
775def _parse_canonical_minkey(doc: Any, dummy0: Any) -> MinKey:
776 """Decode a JSON MinKey to bson.min_key.MinKey."""
777 if type(doc["$minKey"]) is not int or doc["$minKey"] != 1: # noqa: E721
778 raise TypeError(f"$minKey value must be 1: {doc}")
779 if len(doc) != 1:
780 raise TypeError(f"Bad $minKey, extra field(s): {doc}")
781 return MinKey()
782
783
784def _parse_canonical_maxkey(doc: Any, dummy0: Any) -> MaxKey:

Callers

nothing calls this directly

Calls 1

MinKeyClass · 0.90

Tested by

no test coverage detected