title: Mongo user privilege to read and write to any database
body: <p>Mongo newb here.  I have a mongo installation with four databases and would like to create a user that can read and write to all the databases.  I tried:</p>
  
  <pre><code>use admin;
  db.addUser({user: "foo" , pwd: "bar", roles: [  "readWriteAnyDatabase" ]})
  </code></pre>
  
  <p>but when I try to do</p>
  
  <pre><code>mongo someotherdb -u foo -p
  </code></pre>
  
  <p>and authenticate with the correct password it gives me an authentication error.</p>
  
  <p>I also tried manually adding the users to the other databases by doing this</p>
  
  <pre><code>use someotherdb
  db.addUser({user: "foo", roles: ['readWrite'], userSource: "admin"});
  </code></pre>
  
  <p>and still no dice trying to log in via the mongo shell or using the auth command in the target db.</p>
  
  <p>Am I doing something wrong?  How do you go about making a user who can globally read and write to any db?  Do you have to add said user to each db's system.users collection or is that not necessary if they have the "readWriteAnyDatabase" role?</p>
  
  <p>I'm using mongo 2.4 on ubuntu.</p>