I’m trying to execute admin commands from Atlas Serverless Functions, I’m unable to figure out how to execute admin commands such as currentOp
The docs explain the use of admin()
which returns an instance of AdminDatabase
but it’s unclear how to execute commands through this object.
It explains The mongodb.admin() method returns an AdminDatabase object. The object contains helper methods that wrap a subset of MongoDB database commands. See admin.getDBNames()
But doesn’t expand on any additional functions/commands.
I would expect that I’d be able to execute commands like context.service.get('Cluster0').admin().command({currentOp: 1})
Any additional guidance would be much appreciated.