Skip to content

Commit 2c4a1a9

Browse files
author
Bob Grabar
committed
DOCS-1153 add an example to db.addUser()
1 parent e092ff0 commit 2c4a1a9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/reference/method/db.addUser.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ db.addUser()
44

55
.. default-domain:: mongodb
66

7-
.. method:: db.addUser("username", "password"[, readOnly])
7+
.. method:: db.addUser("username", "password" [, readOnly] )
88

99
:param string username: Specifies a new username.
1010

@@ -17,3 +17,9 @@ db.addUser()
1717
username and password as arguments to the command. If you want to
1818
restrict the user to have only read-only privileges, supply a true
1919
third argument; however, this defaults to false.
20+
21+
For example:
22+
23+
.. code-block:: javascript
24+
25+
db.addUser("user1" , "pass" , { readOnly : true } )

0 commit comments

Comments
 (0)