I am in need of creating a code to hide/unhide mongo index in node. There are no such methods on node-mongodb-native although they exist on mongo shell.
Second attempt was to run a custom command, but await db.command({ hideIndex: 'some_name' })
ended up with MongoServerError: no such command: 'hideIndex'
.
Lastly, I am aware that in older versions there were execute/eval methods, but it looks like they were removed at some point. I know it poses some security issues allowing someone to run custom commands, but I don't believe no one ever needed something custom to be run from node with the list of methods available in driver being so limited?
Which raises a question: how does one run a custom command in node mongodb driver?