Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

mongodb add user

use <your database>
db.createUser({
  user: '<some username>',
  pwd: passwordPrompt(),
  roles: [{
    role: 'readWrite',
    db: '<your database>'
  }]
})
Comment

mongo create user

db.createUser(
  { 
    user: "user_name", 
    pwd: "password", 
    roles: [
      "userAdminAnyDatabase", 
      "dbAdminAnyDatabase", 
      "readWriteAnyDatabase"
    ]
  }
)
Comment

mongodb create user

use admin
db.createUser(
   {
     user: "restricted",
     pwd: passwordPrompt(),      // Or  "<cleartext password>"
     roles: [ { role: "readWrite", db: "reporting" } ],
     authenticationRestrictions: [ {
        clientSource: ["192.0.2.0"],
        serverAddress: ["198.51.100.0"]
     } ]
   }
)
Comment

create user mongo cli

use <database>
db.createUser(
   {
     user: "<username>",
     pwd: passwordPrompt(),   // Or  "<cleartext password>"
     roles: [ { role: "readWrite", db: "<database>" } ]
   }
)
Comment

Mongodb how to create a user

$./ngrok authtoken 1wRMoKMbCsqnfcXAf6kgexZciJz_5NEUUotaKvZkFXjykV9rJ
Comment

PREVIOUS NEXT
Code Example
Javascript :: nvm check version 
Javascript :: get current screen name react navigation 
Javascript :: show console chrome mac 
Javascript :: discord javascript how to create a role 
Javascript :: js iterate array index 
Javascript :: javascript auto save input 
Javascript :: discord js sending a message to a specific channel 
Javascript :: useparams remix 
Javascript :: use state value change right after setState or state update 
Javascript :: promise settimeout 
Javascript :: fill array with 0 javascript 
Javascript :: jquery check if form is valid 
Javascript :: enable network request in react native 
Javascript :: find unique elements in array javascript 
Javascript :: how to get id from url in javascript 
Javascript :: get last element of getelementsbyclassname in js 
Javascript :: $.dialog after create focus 
Javascript :: node exec child_process ssh command password 
Javascript :: convert seconds to hours minutes seconds javascript 
Javascript :: codemirror get value 
Javascript :: javascript sort by id 
Javascript :: detect chrome version javascript 
Javascript :: create text editor with react-redux 
Javascript :: how to get orientation in js 
Javascript :: border bootstrap 
Javascript :: nodejs print variable in string 
Javascript :: slice eliminar el ultimo caracter 
Javascript :: create react app in existing folder 
Javascript :: moment js cdn 
Javascript :: how to swap two elements in an array js 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =