- Reference >
- JavaScript Methods >
- db.addUser()
db.addUser()¶
-
db.
addUser
("username", "password"[, readOnly])¶ Parameters: - username (string) – Specifies a new username.
- password (string) – Specifies the corresponding password.
- readOnly (boolean) – Optional. Restrict a user to read-privileges only. Defaults to false.
Use this function to create new database users, by specifying a username and password as arguments to the command. If you want to restrict the user to have only read-only privileges, supply a true third argument; as in the following example:
By default the
readOnly
option, isfalse
.