title: How to create new User with password on MongoDB and connect from NodeJS application
body: <p>I need some help with setting up my NodeJS application to connect with the MongoDB with credentials.</p>
  
  <p>I'm confused with creating user on the <code>admin</code> database, or on the database I will store my documents, and then connecting to it from my application.</p>
  
  <p>So, let's say I have this MongoDB service running on <code>localhost</code> port <code>27017</code> and my database is called <code>myAmazingApp</code>. I want to create a user with Read/Write permissions on this now empty database and set user <code>userApp</code> and password <code>passwordApp</code>.</p>
  
  <p>I'm using <code>Mongoose</code> on NodeJS.</p>
  
  <p>My question includes where and how I must create this User/Role/whatever on MongoDB.</p>
  
  <p>By the way, right now this is my connection string</p>
  
  <p><code>mongodb://userApp:passwordApp@localhost:27017/myAmazingApp</code> and I am connecting with <code>mongoose.connect</code>. </p>
  
  <p>It gives me <strong>Authentication failed</strong></p>