Permissions on air_alliances

I am working on M121 chapter 3 lab ($lookup) but I don’t seem to have permissions on air_alliances with the generic user “m121” - any fix?

MongoDB Enterprise Cluster0-shard-0:PRIMARY> db.air_alliance.findOne()
uncaught exception: Error: error: {
“operationTime” : Timestamp(1612537316, 1),
“ok” : 0,
“errmsg” : “not authorized on air_alliance to execute command { find: “air_alliance”, filter: {}, limit: 1.0, singleBatch: true, lsid: { id: UUID(“d7f1d81b-2ed8-4489-a06e-a7397d571639”) }, $clusterTime: { clusterTime: Timestamp(1612537306, 1), signature: { hash: BinData(0, 0B99AE62904203AF3738A8C00656ED778AF42967), keyId: 6902062171803353090 } }, $db: “air_alliance” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1612537316, 1),
“signature” : {
“hash” : BinData(0,“hnGdhHPFX2ZmSNeWuCPNL4xZs1E=”),
“keyId” : NumberLong(“6902062171803353090”)
}
}
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBCommandCursor@src/mongo/shell/query.js:703:15
DBQuery.prototype._exec@src/mongo/shell/query.js:112:28
DBQuery.prototype.hasNext@src/mongo/shell/query.js:287:5
DBCollection.prototype.findOne@src/mongo/shell/collection.js:260:10
@(shell):1:1

You are using the wrong database. You should be using the aggregations database.

1 Like

D’oh. Thanks