Not authorized on admin to execute command mongoDB: Atlas M0 Free Tier cluster
-
12-01-2021 - |
Question
My MongoDB shell has version v3.6.5 (the same with older versions) & MongoDB server has version: 3.6.8
I have MongoDB M0 Free Tier cluster and I want to use from shell different commands.
So, I created admin user with password:
And then connect via MongoDB shell using admin user:
Up to this point, everything is fine, but when I started to use commands I get always the issue:
I checked the answer from here and tried to create admin user directly from mongodb shell using command, but also the same error:
Why it happens? If I has already created admin user? Can someone explain me, thanks a lot in advance.
Solution
Since you are using a hosted database service (MongoDB Atlas), many administrative commands are limited as they are either provided via the management interface or likely to introduce performance/stability issues.
The Atlas free tier has additional limitations since it is backed by a shared MongoDB instance. See: Unsupported Commands in M0/M2/M5 Clusters.
"not authorized on admin to execute command {setFeatureCompatibilityVersion: \"3.4\" }"
The setFeatureCompatibilityVersion
command is an administrative command used during upgrades. You cannot set this on Atlas Free Tier (M0) or shared (M2/M5) clusters.
db.createUser(...)
User permissions and roles for MongoDB Atlas must be managed via the Atlas user interface or API. See: Add MongoDB Users.