title: Mongo aggregation framework: what is the lock level of the last stage $out operation?
body: <p>Using Mongo's aggregation pipeline it is possible to write query result to a collection (existent or new) using <code>$out</code> stage, like that</p>
  
  <pre class="lang-js prettyprint-override"><code>db.my_collection.aggregate([ { $match: { my_field: 'my_value' } }, { $out: 'my_new_collection' } ])
  </code></pre>
  
  <p>The question is what kind of lock does Mongo use while writing to <code>my_new_collection</code>? Is it a 'regular' write lock, or a <em>global</em> lock, like Map Reduce?</p>
  
  <p><a href="http://docs.mongodb.org/manual/core/map-reduce-concurrency/" rel="noreferrer">Map Reduce lock reference</a></p>