title: Mongo User Defined Functions and Map Reduce
body: <p>Is there a way in mongo to create user-defined Javascript functions. I have several Map/Reduce functions on the client side that i would like to use within other MR functions. </p>
  
  <p>For example, several MR functions calculate all sorts of averages. I want to be able to use them like so :</p>
  
  <pre><code>function reduce(k,v)
  {
      if (val &gt; myDatabaseAverage())
      // ..do something
  }
  </code></pre>