[SERVER-38353] show collections does not list system.* collections from admin db on 4.0 Created: 30/Nov/18  Updated: 27/Oct/23  Resolved: 01/Dec/18

Status: Closed
Project: Core Server
Component/s: Admin, Shell
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Tanveer Madan Marate Assignee: Kelsey Schubert
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-38867 "show collections" no longer lists sy... Closed
Participants:

 Description   
Original Summary

Cannot lookup system.* collection from admin database after upgrade to 4.0

Original Description

Hi All,

 

I am unable to lookup system.* collections under admin database which I was able to when on 3.6 using show collections
MongoDB server version: 3.6.9
dev:PRIMARY> use admin
switched to db admin

dev:PRIMARY> show collections
system.keys
system.profile
system.roles
system.users
system.version
dev:PRIMARY>

 

MongoDB server version: 4.0.4

dev:PRIMARY> use admin
switched to db admin

dev:PRIMARY> show collections

dev:PRIMARY>

 

Thanks,

Tanveer 

 



 Comments   
Comment by Kelsey Schubert [ 01/Dec/18 ]

Hi tanveerm@xilinx.com,

Thanks for the report, this change of behavior is expected and is documented here: https://docs.mongodb.com/manual/reference/command/listCollections/index.html#show-collections

This change enables users who do not have the listCollections privilege to quickly see which collections they are authorized to access from the shell.

If you would like to see all collections and have the listCollections privilege, I would suggest running the the command explicitly:

db.runCommand( { listCollections: 1.0, nameOnly: true } )

Kind regards,
Kelsey

Generated at Thu Feb 08 04:48:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.