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

Function _parse_canonical_maxkey

bson/json_util.py:784–790  ·  view source on GitHub ↗

Decode a JSON MaxKey to bson.max_key.MaxKey.

(doc: Any, dummy0: Any)

Source from the content-addressed store, hash-verified

782
783
784def _parse_canonical_maxkey(doc: Any, dummy0: Any) -> MaxKey:
785 """Decode a JSON MaxKey to bson.max_key.MaxKey."""
786 if type(doc["$maxKey"]) is not int or doc["$maxKey"] != 1: # noqa: E721
787 raise TypeError("$maxKey value must be 1: %s", (doc,))
788 if len(doc) != 1:
789 raise TypeError(f"Bad $minKey, extra field(s): {doc}")
790 return MaxKey()
791
792
793def _parse_binary(doc: Any, json_options: JSONOptions) -> Union[Binary, uuid.UUID]:

Callers

nothing calls this directly

Calls 1

MaxKeyClass · 0.90

Tested by

no test coverage detected