Skip to content

DOCS-4137: Document dropDatabase() change #2044

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
2 changes: 2 additions & 0 deletions source/core/authentication.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ their membership <inter-process-auth>` to their respective
replica set or sharded cluster. See :ref:`inter-process-auth`
for more information.

.. _authentication-client-users:

Client Users
------------

Expand Down
7 changes: 7 additions & 0 deletions source/includes/fact-drop-database-users.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. versionchanged:: 2.6

This command does not delete the
:ref:`users <authentication-client-users>` associated with the current
database. To drop the associated users, run the
:dbcommand:`dropAllUsersFromDatabase` command in the database you are
deleting.
22 changes: 11 additions & 11 deletions source/reference/command/dropDatabase.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ dropDatabase

.. dbcommand:: dropDatabase

The :dbcommand:`dropDatabase` command drops a database, deleting
the associated data files. :dbcommand:`dropDatabase` operates on the
current database.
The :dbcommand:`dropDatabase` command drops the current database, deleting
the associated data files.

In the shell issue the ``use <database>``
command, replacing ``<database>`` with the name of the database
you wish to delete. Then use the following command form:
.. include:: /includes/fact-drop-database-users.rst

To run this command, issue the ``use <database>`` command in the shell,
replacing ``<database>`` with the name of the database you wish to delete.
Then use the following command form:

.. code-block:: javascript

{ dropDatabase: 1 }

The :program:`mongo` shell also provides the following equivalent helper method:

.. code-block:: javascript

db.dropDatabase();
The :program:`mongo` shell also provides the following equivalent helper method
:method:`db.dropDatabase()`.

.. include:: /includes/warning-blocking-global.rst

.. write-lock

.. seealso:: :dbcommand:`dropAllUsersFromDatabase`
4 changes: 4 additions & 0 deletions source/reference/method/db.dropDatabase.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ db.dropDatabase()
Removes the current database. Does not change the current database,
so the insertion of any documents in this database will allocate a
fresh set of data files.

.. include:: /includes/fact-drop-database-users.rst

.. seealso:: :dbcommand:`dropDatabase`