MongoDB - grantRolesToUser is rolled back?
<p>Replicaset - Mongo version 3.2.4, I use bash script to update mongo permission in some situations, something like :</p>

<pre><code>mongo &lt;&lt;EOF
  db["grantRolesToUser"]("someone", ["readWriteAnyDatabase"]);
  print(JSON.stringify(db.getUsers()));
EOF
</code></pre>

<p>Basically, adding readWriteAnyDatabase role to "someone".</p>

<p>It works, and the print shows the user with the new role.
However, 2-3 seconds later. it's gone !!</p>

<p>Any thoughts on what could be causing this?</p>