title: Does mongodb's eval() lock the database or not?
body: <p>According to the documentation:</p>
  
  <pre><code>By default, eval takes a global write lock before evaluating the
  JavaScript function.
  </code></pre>
  
  <p>But you can pass an option to disable this write lock:</p>
  
  <pre><code>Set nolock to true on the eval command to prevent the eval command
  from taking the global write lock before evaluating the JavaScript.
  </code></pre>
  
  <p>But then I see this warning:</p>
  
  <pre><code>Do not use eval for long running operations as eval blocks all
  other operations. Consider using other server side code execution options.
  </code></pre>
  
  <p>So, what is it? Does eval() halt every other operation from running or not?</p>
  
  <p>And if it does: why would you be able to disable the "global write lock", as nothing else can run anyway?</p>