Not able to connect to movies database

Hello,

I am trying to connect to the cluster using following 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

I am able to see all the databases, but when I try to query or see collections, it says

Error: error: {
“operationTime” : Timestamp(1534977860, 1),
“ok” : 0,
“errmsg” : “not authorized on movies to execute command { find: “movies”, filter: {}, limit: 1.0, singleBatch: true, $clusterTime: { clusterTime: Timestamp(1534977830, 1), signature: { hash: BinData(0, 98FC1CF3C0991A49183442F7494D3538945B8BDE), keyId: 6559514413705986049 } }, $db: “movies” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1534977860, 1),
“signature” : {
“hash” : BinData(0,“5qwrt1u/iBzmoDny0CFQqMH/7yw=”),
“keyId” : NumberLong(“6559514413705986049”)
}
}
}

Run use aggregations, then do show collections.

Hi,

It looks like you are on the movies database, which you do not have access to. As @shafeh pointed out, use the movies collection in the aggregations database.

José Carlos

Yes, that worked for me.

Thanks guys

You are welcome!

José Carlos