Skip to content

DOCS-11103 - Updates to listDatabases command #3319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion source/reference/command/listDatabases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Definition

.. include:: /includes/apiargs/dbcommand-listDatabases-field.rst


Output
------

Expand All @@ -54,6 +53,25 @@ Output
- A field named ``totalSize`` whose value is the sum of all the
``sizeOnDisk`` fields in bytes.

Behavior
--------

.. versionchanged:: 4.0

When :doc:`authentication </core/authentication>` is enabled, the
:dbcommand:`listDatabases` command returns different values based on
the :doc:`privilege actions </reference/privilege-actions/>`
assigned to the user who executes the command.

- If the user has the :authaction:`listDatabases` privilege action,
the :dbcommand:`listDatabases` command returns a list of all
existing databases.

- If the user does not have the :authaction:`listDatabases`
privilege action, the :dbcommand:`listDatabases` command only
returns a list of databases for which the user has the
:authaction:`find` action privilege.

Examples
--------

Expand Down
10 changes: 9 additions & 1 deletion source/release-notes/4.0-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ General
- MongoDB removes the obsolete ``logUserIds`` parameter. Use
:doc:`/core/auditing` instead.

- When :doc:`authentication </core/authentication>` is enabled, running
the :dbcommand:`listDatabases` command without the
:authaction:`listDatabases` action privilege returns a list of all
databases on which the user running the command has the
:authaction:`find` action privilege. In previous versions, running
the command without the :authaction:`listDatabases` action resulted
in an ``Unauthorized`` response.

Removed Binary and Deprecated Fields/Commands
---------------------------------------------

Expand Down Expand Up @@ -201,6 +209,6 @@ Output Field Changes
- The :pipeline:`$currentOp` aggregation stage, the
:dbcommand:`currentOp` command, and :method:`db.currentOp()` helper
no longer return the ``threadId`` field in their outputs.

- The :dbcommand:`serverStatus` command now always returns ``0`` for
the :serverstatus:`asserts.warning` field.