@@ -108,6 +108,7 @@ Show Help for Specific Database Method
108
108
The output resembles the following:
109
109
110
110
.. code-block:: none
111
+ :copyable: false
111
112
112
113
db.adminCommand({ serverStatus: 1 }):
113
114
@@ -218,7 +219,7 @@ Show Help for Specific Collection Method
218
219
Show Additional Usage Details for a Collection Method
219
220
To see additional usage details for a collection method in
220
221
``mongosh``, type the ``db.<collection>.<method>`` name without the
221
- parenthesis (``()``) The following example returns
222
+ parenthesis (``()``). The following example returns
222
223
details about the :method:`~db.collection.insertOne()` method:
223
224
224
225
.. code-block:: javascript
@@ -291,3 +292,67 @@ the following commands:
291
292
- ``ObjectId``
292
293
- ``Symbol`` *(Deprecated)*
293
294
- ``Timestamp``
295
+
296
+ Command Helpers
297
+ ---------------
298
+
299
+ ``mongosh`` provides the following methods and commands to wrap
300
+ certain database commands and obtain information on your deployment:
301
+
302
+ .. list-table::
303
+ :header-rows: 1
304
+ :widths: 30 70
305
+
306
+ * - Help Methods and Commands
307
+ - Description
308
+
309
+ * - ``help``
310
+
311
+ - Show help.
312
+
313
+ * - :method:`db.help()`
314
+
315
+ - Show help for database methods.
316
+
317
+ * - :method:`db.\<collection\>.help() <db.collection.help>`
318
+
319
+ - Show help on collection methods. The ``<collection>`` can be the
320
+ name of an existing collection or a non-existing collection.
321
+
322
+ * - ``show dbs``
323
+
324
+ - Print a list of all databases on the server.
325
+
326
+ .. note::
327
+
328
+ ``show dbs`` is synonymous with ``show databases``.
329
+
330
+ * - ``use <db>``
331
+
332
+ - Switch current database to ``<db>``. The ``mongosh`` variable
333
+ ``db`` is set to the current database.
334
+
335
+ * - ``show collections``
336
+
337
+ - Print a list of all collections for current database
338
+
339
+ * - ``show users``
340
+
341
+ - Print a list of users for current database.
342
+
343
+ * - ``show roles``
344
+
345
+ - Print a list of all roles, both user-defined and built-in, for
346
+ the current database.
347
+
348
+ * - ``show profile``
349
+
350
+ - Print the five most recent operations that took 1 millisecond or
351
+ more. See documentation on the
352
+ :manual:`database profiler
353
+ </tutorial/manage-the-database-profiler>` for more information.d
354
+
355
+ * - ``load()``
356
+
357
+ - Execute a JavaScript file. See :doc:`/write-scripts` for more
358
+ information.
0 commit comments