Unauthorize to execute command

Hi,
I’m finishing Chapter 1, and after switching to db.video, I’m receiving the following error when trying to execute the code that’s provided at the Lecture - Optional Lab - Expressions with $project:

db.movies.findOne({title: “Life Is Beautiful”}, { _id: 0, cast: 1, writers: 1})
2018-09-23T13:01:40.579-0300 E QUERY [js] Error: error: {
“operationTime” : Timestamp(1537718520, 1),
“ok” : 0,
“errmsg” : “not authorized on video to execute command { find: “movies”, filter: { title: “Life Is Beautiful” }, limit: 1.0, singleBatch: true, projection: { _id: 0.0, cast: 1.0, writers: 1.0 }, lsid: { id: UUID(“d113063b-0498-40a1-9b9b-bef454f131ed”) }, $clusterTime: { clusterTime: Timestamp(1537718490, 1), signature: { hash: BinData(0, 6EEB8FF4545E63DE1193F76E7E241421B7774163), keyId: 6559514413705986049 } }, $db: “video” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1537718520, 1),
“signature” : {
“hash” : BinData(0,“eFhVJS7vh5uE9maWEKZE7Hgv+UI=”),
“keyId” : NumberLong(“6559514413705986049”)
}
}
} :
_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:254:10
@(shell):1:1

Hope, you can help me!

Thanks

Santi

Hi,

Please use the aggregations database, you’ll find the movies collection in that database.

José Carlos

Thanks Jose for the quick answer.

Sorry, I saw movies and thought that it was still video db

Thanks again, that solved my issue!

Not a problem… glad to help!