I am using the Atlas free cluster mongodb and try to enable the profiler for the monitoring purpose and I have an Atlas Admin access on the cluster
On the setting, the profiler option is enabled as in the diagram above
While I am running the command db.setProfilingLevel(2)
getting the below error:
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db.setProfilingLevel(2)
2020-02-01T11:52:51.976+1100 E QUERY [js] uncaught exception: Error: command failed: {
"ok" : 0,
"errmsg" : "CMD_NOT_ALLOWED: profile",
"code" : 8000,
"codeName" : "AtlasError"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:583:17
assert.commandWorked@src/mongo/shell/assert.js:673:16
DB.prototype.setProfilingLevel@src/mongo/shell/db.js:681:12
@(shell):1:1