title: How to run db.eval with authorization in MongoDB
body: <p>I've tried a function with db.eval but it doesn't work, it thrown an exception that says - <em>not authorized on 'myCollection' to execute command { $eval: \"FunctionX()\"}</em>.</p>
  
  <p>The authorization is enabled</p>
  
  <p>I've also maken a role like this:</p>
  
  <pre><code>{ createRole: "RunEval",
      privileges: [
          { resource: { anyResource: true }, actions: ["anyAction"] }
      ],
      roles: []
  }
  </code></pre>
  
  <p>and added the role to user.</p>
  
  <p>I use MongoDB v2.6</p>
  
  <p>Anybody may help me?</p>