Closed mateodelnorte closed 9 years ago
that's because the user you authenticated with cannot run the profile
command:
http://docs.mongodb.org/manual/reference/command/profile/
mongo-hacker uses that command to know how long that query took, if used an index, etc.
You can either:
profile
action to the user's custom roleconfig.js
file: https://github.com/TylerBrock/mongo-hacker/blob/master/config.js#L14Git it. Thx.
I just encountered this issue and got here from Google. My admin is away and cannot be bothered to add the profile action to my role.
@gianpaj https://github.com/TylerBrock/mongo-hacker/blob/master/config.js#L14 is actually
index_paranoia: false, // querytime explain
According to https://tylerbrock.github.io/mongo-hacker/ if the above is set to true, then index usage will be printed on every query. Is that what really needs to be tweaked in order to get rid of:
Error: profile command failed: {
"ok": 0,
"errmsg": "not authorized on mydb to execute command { profile: -1.0 }",
"code": 13,
"codeName": "Unauthorized"
}
Thanks
The following command
gets the following error
while doing find() calls against other collections works perfectly fine.