See repro. We should probably just uassert for this, to avoid filling the system log with unnecessary backtraces.
Repro steps:
1. start mongod
2. start mongo shell
3. issue shell commands:
> use $bad
switched to db $bad
> db.createCollection("a")
{
"operationTime" : Timestamp(0, 0),
"ok" : 0,
"errmsg" : "cannot do createCollection on namespace with a $ in it: $bad.a",
"code" : 17320,
"codeName" : "Location17320"
}
4. observe backtrace in mongod system log
Expected behavior: step 4 should observe no backtrace.