MongoDB provides a Javascript shell. But Javascript is no fun without Underscore.js
Turned out its straight forward to use Underscore.js while scripting mongodb.
- Download or clone Underscore.js and run...
% mongo server:27017/dbname underscore.js my_commands.js