This version will reach end of life on Feb 2018. To upgrade, go to the Learn more about upgrading your version of MongoDB.



db.loadServerScripts() loads all scripts in the system.js collection for the current database into the mongo shell session.

Documents in the system.js collection have the following prototype form:

{ _id : "<name>" , value : <function> } }

The documents in the system.js collection provide functions that your applications can use in any JavaScript context with MongoDB in this database. These contexts include $where clauses and mapReduce operations.