|
This affects 3.6 and potentially earlier servers.
Database exists, collection does not:
MongoDB Enterprise mongos> db.runCommand({collStats:'foo'})
|
{
|
"sharded" : false,
|
"primary" : "shard01",
|
"ns" : "mongoid_test.foo",
|
"ok" : 0,
|
"errmsg" : "Collection [mongoid_test.foo] not found.",
|
"operationTime" : Timestamp(1596397090, 1),
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1596397090, 1),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
}
|
}
|
Neither database nor collection exist:
MongoDB Enterprise mongos> db.runCommand({collStats:'foo'})
|
{
|
"ok" : 0,
|
"errmsg" : "database bar not found",
|
"code" : 26,
|
"codeName" : "NamespaceNotFound",
|
"operationTime" : Timestamp(1596397102, 1),
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1596397102, 1),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
}
|
}
|
Note that the second command had an error code (26) and the first command did not have an error code.
4.0 uses error code 8 here as far as I can tell.
|