One of our MongoDB databases contains a collection called system.views and I cannot find any information for this collection in Mongo Doc:
https://docs.mongodb.com/manual/reference/system-collections/
When I use admin user to execute command:
db.system.views.findOne()
It returns an authorization error:
"errmsg" : "not authorized on <database> to execute command { find: \"system.views\", filter: {}, limit: 1.0, singleBatch: true, lsid: { id: UUID(\"98bfa592-4d51-4d4a-964c-687c97444a2c\")}, $clusterTime: { clusterTime: Timestamp(1568022175, 1), signature: { hash: BinData(0, 316762B835CC7EBA0A70B314421B9366D679415C), keyId: 6723325935254241281 } }, $db: \"<database>\" }",
Admin user has roles
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
},
{
"role" : "clusterAdmin",
"db" : "admin"
},
{
"role" : "dbAdminAnyDatabase",
"db" : "admin"
},
{
"role" : "readWriteAnyDatabase",
"db" : "admin"
}
]
We are using mongodb x509 authentication mechanism.
My question:
- What is this system.views collection?
- How can I get my admin user authorised to run command on this collection?
Many thanks.