For db:
https://github.com/mongodb/mongo/blob/0b805a4119272e83f9ffe9bf7990397be9b0c7e9/src/mongo/db/namespace_string.h#L165
For coll:
https://github.com/mongodb/mongo/blob/0b805a4119272e83f9ffe9bf7990397be9b0c7e9/src/mongo/db/namespace_string.h#L168