"errmsg" : "not authorized on solarSystem to execute command

Hi!! , I am a new learner , I am getting this error message when i am trying to execute the command “db.solarSystem.aggregate([{
“$match”: { “type”: { “$ne”: “Star” } }
}]).pretty()”

OR

db.solarSystem.count()

2018-08-22T13:38:47.467+0530 E QUERY [js] Error: count failed: {
“operationTime” : Timestamp(1534925319, 1),
“ok” : 0,
“errmsg” : “not authorized on solarSystem to execute command { count: “solarSystem”, query: {}, fields: {}, lsid: { id: UUID(“96e4e162-378e-4271-941b-a2ec599f783d”) }, $clusterTime: { clusterTime: Timestamp(1534925227, 6), signature: { hash: BinData(0, CAB586E56EDFCDF8EA2F94C0E832ECC0F2900F6C), keyId: 6559514413705986049 } }, $db: “solarSystem” }”,

It seems that i am not authorised to run these command on this cluster …

Please suggest.

Thanks

Hi,

Please check if you are on the aggregations database, with the user m121 and password aggregations. Try using this command:

mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

José Carlos

2 Likes

Thanks , It worked !!

You are welcome.

José Carlos