command for create user in mongodb code example
Example: mongodb create user
use admin
db.createUser(
{
user: "restricted",
pwd: passwordPrompt(), // Or ""
roles: [ { role: "readWrite", db: "reporting" } ],
authenticationRestrictions: [ {
clientSource: ["192.0.2.0"],
serverAddress: ["198.51.100.0"]
} ]
}
)