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
As mentioned by @Remon van Vliet,
You will have to use,
db.system.js.save( { _id : "myDatabaseAverage" , value : function(){ // ..do something } } );
to save your function first,
and then you need to call,
db.loadServerScripts();
before you execute your function.