@@ -4,26 +4,43 @@ dropDatabase
44
55.. default-domain:: mongodb
66
7+ Definition
8+ ----------
9+
710.. dbcommand:: dropDatabase
811
912 The :dbcommand:`dropDatabase` command drops the current database, deleting
1013 the associated data files.
1114
12- .. include:: /includes/fact-drop-database-users.rst
13-
14- To run this command, issue the ``use <database>`` command in the shell,
15- replacing ``<database>`` with the name of the database you wish to delete.
16- Then use the following command form:
15+ The command has the following form:
1716
1817 .. code-block:: javascript
1918
2019 { dropDatabase: 1 }
2120
22- The :program:`mongo` shell also provides the following equivalent helper method
21+ The :program:`mongo` shell also provides the helper method
2322 :method:`db.dropDatabase()`.
2423
25- .. include:: /includes/warning-blocking-global.rst
24+ Behavior
25+ --------
26+
27+ .. include:: /includes/warning-blocking-global.rst
28+
29+ .. include:: /includes/fact-drop-database-users.rst
30+
31+ Example
32+ -------
33+
34+ The following example in the :program:`mongo` shell uses the ``use
35+ <database>`` operation to switch the current database to the ``temp``
36+ database and then uses the :dbcommand:`dropDatabase` command to drop
37+ the ``temp`` database:
38+
39+ .. code-block:: javascript
40+
41+ use temp
42+ db.runCommand( { dropDatabase: 1 } )
2643
27- .. write-lock
44+ .. write-lock
2845
2946.. seealso:: :dbcommand:`dropAllUsersFromDatabase`
0 commit comments