title: I understand how to create a user in MySQL that a web app would utilize - how can I do the same in MongoDB?
body: <p>As a veteran web developer - I get <em>connection strings</em>. </p>
  
  <p>I've seen them inside WordPress wp-config.php files, I've seen them in many a ASP.NET app.config file. I know how to go into a MySQL installation and create a userName@&lt;specific-host> and grant them all-privileges (or a subset) so that the web application can then use that credential to connect.</p>
  
  <p>I know how to go into the Security section of MS SQL Server and set up an integrated user or a SQL-only login user.. etc..</p>
  
  <p>Can someone use any of the above technologies to draw an analogy and help me better understand how to create a user in MongoDB (yes, I can google that) on a particular database that has 'all privileges' and then what the resulting connection string ought to look like?</p>
  
  <p>When I'm in the mongo shell, is there not a default block of JSON, with well known roles.. <strong>appropriate for a web application</strong> that I should pass into a db.createUser() call? I can't seem to find this where I've been looking.</p>
  
  <hr>
  
  <p><strong>EDIT</strong> In addition to implementing Markus Mahlberg's beautiful answer below - I found I was getting an authentication error which required <a href="https://stackoverflow.com/a/31476552/1520850">this S.O. fix, moving the auth version from 5 back down to 3</a> and this required that I recreate my admin user with role:"root" before proceeding.</p>