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

Function _check_name

pymongo/database_shared.py:24–31  ·  view source on GitHub ↗

Check if a database name is valid.

(name: str)

Source from the content-addressed store, hash-verified

22
23
24def _check_name(name: str) -> None:
25 """Check if a database name is valid."""
26 if not name:
27 raise InvalidName("database name cannot be the empty string")
28
29 for invalid_char in [" ", ".", "$", "/", "\\", "\x00", '"']:
30 if invalid_char in name:
31 raise InvalidName("database names cannot contain the character %r" % invalid_char)
32
33
34_CodecDocumentType = TypeVar("_CodecDocumentType", bound=Mapping[str, Any])

Callers 2

__init__Method · 0.90
__init__Method · 0.90

Calls 1

InvalidNameClass · 0.90

Tested by

no test coverage detected