Hi there,
We’ve got a weird situation where a certain command is exposed by db.runCommand
but not via the db.$cmds
virtual collection on an Atlas cluster.
We are not able to change the way a query is being run because we are using a third party tool which is connecting directly to MongoDB to run the queries. The queries are for example:
db.runCommand({ $query: { count: "collection" } })
and
db.$cmd.findOne({ $query: { count: "collection" } })
Both queries work fine on MongoDB 5.0.7 installed locally; however, on MongoDB 5.0.7 in Atlas I get for the second query (via $cmd
):
{
"ok" : 0.0,
"errmsg" : "command not found",
"code" : 59.0,
"codeName" : "CommandNotFound"
}
The command clearly exists, though, because db.runCommand
works just fine.
This feels like a bug. It works with the same version of MongoDB locally and works when using db.runCommand
, but not via db.$cmds
.
I accept the third party tool probably shouldn’t be using these commands, but it’s annoying that it all works locally but not against the cluster.
Please let me know if there’s something I need to enable/fix to make it work.