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 add admin user

use admin
db.createUser({
  user: "username",
  pwd: "password",
  roles: [ "root" ]
})
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

Mongodb how to create a user

$./ngrok authtoken 1wRMoKMbCsqnfcXAf6kgexZciJz_5NEUUotaKvZkFXjykV9rJ
Comment

PREVIOUS NEXT
Code Example
Javascript :: hide bootstrap modal jquery 
Javascript :: read only javascript 
Javascript :: get position of element 
Javascript :: react native display flex center 
Javascript :: randome words api 
Javascript :: open a new tab when clicking on a link react 
Javascript :: react native margin 
Javascript :: javascript check if objects are equal 
Javascript :: js random number between 1 and 10 
Javascript :: javascript add new array element to start of array 
Javascript :: js create array with n elements 
Javascript :: js split last occurence 
Javascript :: javascript typeof undfined 
Javascript :: pdf.js cdn 
Javascript :: How to change favicon in nextjs. 
Javascript :: get selected option jquery 
Javascript :: javascript get domain 
Javascript :: htmlWebpackPlugin.options.title 
Javascript :: javascript max safe integer 
Javascript :: jquery loop through list elements 
Javascript :: https package node post request 
Javascript :: dispatch keydown event javascript 
Javascript :: fast xml parser nodejs 
Javascript :: remove multiple values from array javascript 
Javascript :: on page fully loaded jquery 
Javascript :: usehistory not found in react-router-dom 
Javascript :: react data attributes event 
Javascript :: find password input jquery 
Javascript :: how to refresh the page using react 
Javascript :: express hello world 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =