Problem accessing movies collection

  1. I connected using the connection string:
    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

No errors

  1. use video
    fine
  2. show collections
    Warning: unable to run listCollections, attempting to approximate collection names by parsing connectionStatus
  3. Try db.movies.findOne()
    2018-11-20T11:03:50.240-0800 E QUERY [js] Error: error: {
    “operationTime” : Timestamp(1542740625, 1),
    “ok” : 0,
    “errmsg” : “not authorized on video to execute command { find: “movies”, filter: {}, limit: 1.0, singleBatch: true, lsid: { id: UUID(“ae7f72e2-69b7-4bac-94a6-2cb6d1dd1883”) }, $clusterTime: { clusterTime: Timestamp(1542740615, 1), signature: { hash: BinData(0, 1C0ECD6FAD75DE2B9AE31E2EFC86EDAF4F451803), keyId: 6595588990781358081 } }, $db: “video” }”,
    “code” : 13,
    “codeName” : “Unauthorized”,
    “$clusterTime” : {
    “clusterTime” : Timestamp(1542740625, 1),
    “signature” : {
    “hash” : BinData(0,“zi+2EU57bYuwpksXLDHahYhgV3E=”),
    “keyId” : NumberLong(“6595588990781358081”)
    }
    }
    } :
    _getErrorWithCode@src/mongo/shell/utils.js:25:13
    DBCommandCursor@src/mongo/shell/query.js:708:1
    DBQuery.prototype._exec@src/mongo/shell/query.js:113:28
    DBQuery.prototype.hasNext@src/mongo/shell/query.js:288:5
    DBCollection.prototype.findOne@src/mongo/shell/collection.js:260:10
    @(shell):1:100:

This is blocking me from completing the lab.
Thanks,
Joe

The Database name is : Aggregations
Try : use aggregations

Hi,

@Amine_83117 is absolutely right, you are trying to access the movies collection in the video database. Just use the aggregations database.

José Carlos

1 Like