Skip to content

Commit b5dcaa5

Browse files
npentreljeff-allen-mongo
authored andcommitted
DOCSP-18271: Add list users page
1 parent 487543f commit b5dcaa5

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

source/core/security-users.txt

+1
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,4 @@ general, clients should connect to the sharded cluster through the
142142

143143
/tutorial/create-users
144144
/tutorial/authenticate-a-user
145+
/tutorial/list-users

source/tutorial/list-users.txt

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. _list-users:
2+
3+
==========
4+
List Users
5+
==========
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 3
13+
:class: singlecol
14+
15+
To list all users, use :binary:`~bin.mongosh` to query the
16+
:doc:`system.users </reference/system-users-collection>` collection:
17+
18+
.. code-block:: sh
19+
20+
use admin
21+
db.system.users.find()
22+
23+
.. important::
24+
25+
Do not modify the :doc:`system.users
26+
</reference/system-users-collection>` collection directly. To manage
27+
users, use the designated :ref:`user management commands
28+
<user-management-commands>`.
29+
30+
To list all users of a :doc:`sharded cluster </sharding>` that were
31+
created through a :binary:`~bin.mongos`, connect to a
32+
:binary:`~bin.mongos` and run the preceding command. MongoDB stores
33+
users that are created through a :binary:`~bin.mongos` in the ``admin``
34+
database of the :term:`config servers <config server>`.
35+
36+
To list all :ref:`shard local users
37+
<shard-local-users>`, connect to the respective shard directly and run
38+
the preceding command. MongoDB stores *shard local* users in the
39+
``admin`` database of the shard itself. These *shard local* users are
40+
independent from the users added to the sharded cluster through a
41+
:binary:`~bin.mongos`. *Shard local* users are local to the shard and
42+
are inaccessible to :binary:`~bin.mongos`.

0 commit comments

Comments
 (0)