What permissions do I need to use the $indexStats?

Sometimes when I execute the following pipeline:

col.aggregate([{$indexStats: {}}])

I get this error:

not authorized on <db-name> to execute command { aggregate: "<col-name>", pipeline: [ { $indexStats: {} } ]...

What permission does my user need to be able to use the $indexStats? I tried looking here, but can’t find any.

Update - found it here, sorry:

Hi @Alex_Bjorlig,

The indexStats requires a specific action:

If you don’t have it in atlas ui , I suggest you temporary add a more powerful user with built in read permission on this database.



This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.