Lab - $match - Getting Error

This is my 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

Then while running any read command i get this (in this case running an aggregation) :

2020-04-09T11:56:37.286+0100 E QUERY [js] uncaught exception: Error: command failed: {
“operationTime” : Timestamp(1586429791, 1),
“ok” : 0,
“errmsg” : “not authorized on video to execute command { aggregate: “movies”, pipeline: [ { $match: { imdb.rating: { $gte: 7.0 }, genres: { $nin: [ “Crime”, “Horror” ] }, rated: { $in: [ “PG”, “G” ] }, languages: { $eq: [ “English”, “Japanese” ] } } } ], cursor: {}, lsid: { id: UUID(“2bf81f81-99ea-433d-88e3-500cd3f4ff71”) }, $clusterTime: { clusterTime: Timestamp(1586429791, 1), signature: { hash: BinData(0, 75B9D763B18A7BC94385E4C81E25FC8DB1F142F0), keyId: 6763648209215553537 } }, $db: “video” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1586429791, 1),
“signature” : {
“hash” : BinData(0,“dbnXY7GKe8lDheTIHiX8jbHxQvA=”),
“keyId” : NumberLong(“6763648209215553537”)
}
}
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:583:17
assert.commandWorked@src/mongo/shell/assert.js:673:16
DB.prototype._runAggregate@src/mongo/shell/db.js:266:5
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1012:12
@(shell):1:1

use aggregations database only.

1 Like