Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create user mongo cli

use <database>
db.createUser(
   {
     user: "<username>",
     pwd: passwordPrompt(),   // Or  "<cleartext password>"
     roles: [ { role: "readWrite", db: "<database>" } ]
   }
)
Source by docs.mongodb.com #
 
PREVIOUS NEXT
Tagged: #create #user #mongo #cli
ADD COMMENT
Topic
Name
1+3 =