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 function
Use
db.system.js.save( { _id : "myDatabaseAverage" , value : function(){ // ..do something } } );
That will store the JS function on the server and can be accessed by m/r from that point on.
For further examples see : mongo/jstests/core/mr_stored.js